coder_gurl
coder_gurl

Reputation: 21

How can I check if a C++ class description has changed?

I have a set of complex C++ classes. After creating objects of the class, all the data can be saved on disk. I want to load two such saved instances and tell if they are identical.

Any ideas on how to do this in a way that is maintainable?

I've tried doing sorted text reports that print all the data and compare that. The problem is fields can get added to the classes over time and its not possible to tell if the report is "complete".

Any way introspection or reflection can be used to accomplish this?

Upvotes: 2

Views: 171

Answers (1)

Richard Hodges
Richard Hodges

Reputation: 69902

this is a complex problem which those wonderful guys at boost.org have already solved for you:

http://www.boost.org/doc/libs/1_58_0/libs/serialization/doc/index.html

Upvotes: 3

Related Questions