13#ifndef DUMUX_PARALLEL_PACKING_HH
14#define DUMUX_PARALLEL_PACKING_HH
24 requires std::is_trivially_copyable_v<T>
25void packValue(std::vector<char>& buf,
const T& value)
27 const auto* p =
reinterpret_cast<const char*
>(&value);
28 buf.insert(buf.end(), p, p +
sizeof(T));
33 requires std::is_trivially_copyable_v<T>
37 std::memcpy(&value, cursor,
sizeof(T));
Definition cvfelocalresidual.hh:25
void packValue(std::vector< char > &buf, const T &value)
Append the raw bytes of a trivially-copyable value to a byte buffer.
Definition packing.hh:25
T unpackValue(const char *&cursor)
Read a trivially-copyable value from a byte buffer and advance the cursor.
Definition packing.hh:34