Boost logo

Boost Users :

From: Andrew Holden (aholden_at_[hidden])
Date: 2008-05-12 14:29:03


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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net