You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently using msgpack to serialize my objects in C++, but the msgpack is not human readable, so I am looking at using JSON. The msgpack-c++ library has a very neat macro called MSGPACK_DEFINE which, in one line, adds msgpack serialization to a class, so that it can be serialized/deserialized to the msgpack format. See example here: https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_adaptor#intrusive-approach
#include<msgpack.hpp>structyour_class {
int a;
std::string b;
MSGPACK_DEFINE(a, b);
};
Does this JSON library feature a similar functionality? It would be very useful.
The text was updated successfully, but these errors were encountered:
I have not thought about going into the serialization business - I think it is a lot of work to do right, and that with cereal there is already a great library for this.
I am currently using msgpack to serialize my objects in C++, but the msgpack is not human readable, so I am looking at using JSON. The msgpack-c++ library has a very neat macro called
MSGPACK_DEFINE
which, in one line, adds msgpack serialization to a class, so that it can be serialized/deserialized to the msgpack format. See example here: https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_adaptor#intrusive-approachDoes this JSON library feature a similar functionality? It would be very useful.
The text was updated successfully, but these errors were encountered: