I recently used boost for development and feel very good. I will write down my thoughts in the future.
When using boost serialization.
A problem occurs when the sequence class is derived. Always prompts "unregist class", but it is clear that related macros are added to the definition file in the class declaration.
... H
# Include <boost/serialization/export. HPP>
/// After the release, the subsequent strings cannot be changed; otherwise, the old files cannot be read.
Boost_class_export_key2 (class1, "class1 ")
... CPP
Boost_class_export_implement (class1)
At last, you can only add the content in the serialization area of the document.
...
STD: ifstream file (filename );
Assert (file. Good ());
Boost: Archive: xml_iarchive AR (File );
Ar. template register_type <class1> ();
...
.
The purpose of the preceding two macros is to eliminate the need to add ar. template register_type <class1>.
it seems that two macros do not work when they exist