6 std::vector<int> v{1,2,3,4};
11 deserialize_and_run<std::vector<int> >(
nullptr,c,[&](std::vector<int>& v2){
15 deserialize_and_run<int >(
nullptr,c,[&](
int& v2){
16 assert(v2 == v.size());
20 assert(size == v.size());
21 assert(v0 == v.at(0));
22 assert(v1 == v.at(1));
23 assert(v2 == v.at(2));
24 assert(v3 == v.at(3));
auto bytes_size(const T &)
Just calls sizeof(T)
auto deserialize_and_run(DeserializationManager *dsm, char *v, const F &fun)
Calls mutils::from_bytes_noalloc<T>(ctx,v), dereferences the result, and passes it to fun...
std::size_t to_bytes(const ByteRepresentable &b, char *v)
calls b.to_bytes(v) when b is a ByteRepresentable; calls std::memcpy() when b is POD.