Torsten Wylegala wrote
But if I serialize the derived class "RequestPackage" and try to deserialize it into the base-class "Package" (Example 2) I'm getting an "input stream error" exception while trying to deserialize with ia >> BOOST_SERIALIZATION_NVP(*package);.
You can't do this. the class loaded must be the exact class saved.
Background information: I want to use xml-serialized objects for data exchange via network and want all the packages to inherit from Package-class which carries "packageId" and therefore give me the chance to identify the incoming xml-objects and handle every package based on this id.
a very common scenario. Look more carefully in the documentation. Look a tests - e.g. test_base_class. Also there are examples. -- View this message in context: http://boost.2283326.n4.nabble.com/Serialization-Deserialization-of-base-cla... Sent from the Boost - Users mailing list archive at Nabble.com.