[Serialize] How to serialize a class with NO serializable data

I applied the PIMPL idiom to one of my larger classes, and it worked great. The visible class records the API with public functions and NO data member except the pointer to the implementation class. That pointer should not be serialized because it is created automatically when the visible class is instantiated. However, if I put NO serialization code in the visible class, the visible class won't (as I understand it) be instantiated when the archive is loaded. (I'm still far away from the point where I can try the archive load for myself.) Should I define the serialize<> function for the class, but with an empty body, since there are no data members to be saved?

Merrill Cornish wrote
Should I define the serialize<> function for the class, but with an empty body, since there are no data members to be saved?
That is not the only solution - but it's a simple and works well - stick with that for now Robert Ramey -- View this message in context: http://boost.2283326.n4.nabble.com/Serialize-How-to-serialize-a-class-with-N... Sent from the Boost - Users mailing list archive at Nabble.com.
participants (2)
-
Merrill Cornish
-
Robert Ramey