-1

Please, give me links, or tell me about "smart" serialization in C++. What is "smart" - i would like to use construction like property in C# near fields of my class, which would indicates, that these fields must be serialized.


Problems: reflection ? What about using macros to compensate for this ?


Maybe there is another way to automate serialization of class's fields ? Without properties and reflection.

Environment: (back-end, server) C++, JSON


UPD0: How about implementation Boost library ?

isnullxbh
  • 807
  • 13
  • 20

1 Answers1

2

There is no reflection in c++, and the preprocessor does not parse c++ code.

You will need to provide functions to serialize and deserialize any type you wish to serialize.

Either roll your own serialization, or use some 3rd party library that has already done so. Boost has serialization that you could try.

evan
  • 1,463
  • 1
  • 10
  • 13