Is it possible to serialize and deserialize a class in C++?

前端 未结 13 2646
我寻月下人不归
我寻月下人不归 2020-11-22 02:18

Is it possible to serialize and deserialize a class in C++?

I\'ve been using Java for 3 years now, and serialization / deserialization is fairly trivial in that lang

13条回答
  •  一向
    一向 (楼主)
    2020-11-22 02:45

    I suggest looking into Abstract factories which is often used as a basis for serialization

    I have answered in another SO question about C++ factories. Please see there if a flexible factory is of interest. I try to describe an old way from ET++ to use macros which has worked great for me.

    ET++ was a project to port old MacApp to C++ and X11. In the effort of it Eric Gamma etc started to think about Design Patterns. ET++ contained automatic ways for serialization and introspection at runtime.

提交回复
热议问题