12 May
2008
12 May
'08
6:29 p.m.
Whiskey Yankee wrote:
Robert Ramey wrote:
Hmmm - consider using variant which lists your classes and serializing the variant.
I assume you mean the boost variant. It looks promising but I wonder how that affects the size of the archive, given that different objects in the "union" will have drastically different sizes themselves?
If I'm reading the header file correctly, a variant is serialized as an integer followed by the serialization of whatever type it holds. The serialization is not affected in any way by the other types the variant might hold; only the one it is holding at the moment. This seems like a pretty efficient way to serialize an arbitrary object.