Serialization of boost::gregorian::date
Hello, Do you know how to serialize class boost::gregorian::date? More generally, is it possible to serialize a class in whose we can't change the code source ? Thanks in advance, Son. -- --------------------------------------------------------- Son NGUYEN KIM Antibes 06600 Tel: 06 48 28 37 47
Quoting Nguyen Kim Son
Hello,
Do you know how to serialize class boost::gregorian::date? More generally, is it possible to serialize a class in whose we can't change the code source ?
Thanks in advance, Son.
It is already serializable - include boost/date_time/gregorian/greg_serialize.hpp In fact it is an example of non-intrusive serialization (uses only public interface) so you could've done this yourself, so yes it is possible. However it _also_ serves as a warning.. the serialization is slow... much slower than would be possible with intrusive serialization which knows about the internal representation. So to conclude, you picked a good example! Pete
participants (2)
-
Nguyen Kim Son
-
Peter Bartlett