It is not always possible to use std::vector, std::array, or c_array[] style types. Right now, deserialization from raw pointer (uint8_t*) requires a copy.
example:
MyStruct raw_pointer_deserialize(const uint8_t* ptr) {
std::error_code ec;
return deserialize<MyStruct>((const uint8_t*)ptr, sizeof(MyStruct), ec);
}
A version of from_bytes with std::is_pointer on the container and runtime size passed in may be all that is needed.
It is not always possible to use std::vector, std::array, or c_array[] style types. Right now, deserialization from raw pointer (uint8_t*) requires a copy.
example:
A version of
from_byteswithstd::is_pointeron the container and runtime size passed in may be all that is needed.