On Jul 16, 2008, at 2:07 PM, Robert Ramey wrote:
So I'll just define serialization in every class in the hierarchy, and make sure each non-root class calls "ar & boost::serialization::base_object
(*this)". Can I use a typedef for the base type, or do I have to use the original name expression? Does this all work for any kind of base: non-polymorphic, polymorphic, virtual inheritance, and/or multiple inheritance?
yes
I guess for multiple inheritance, one would serialize all the (direct) base classes. Do they have to be in declaration order? And for a virtual base class, wouldn't _every_ derived class have to serialize it in its code, since a derived class wouldn't know if it's the final type or not? How do you make sure the virtual base class gets serialized exactly once? Do you use reference counting here, or make sure that multiple-serialization is safe? -- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT hotmail DOT com