Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2007-03-15 22:56:25


Zach Laine wrote:
> I did something stupid with my serialization code. I blithely changed
> the names of several polymorphic classes everywhere they appeared in
> the code, since they had moved out of a class into that class's
> namespace (e.g. SomeNS::View::Primitive became SomeNS::Primitive).
> Several months later, I discovered that I could no longer read old
> binary archives, because I was using Boost.Serialization's
> BOOST_CLASS_EXPORT() macro, and this macro was now registering the
> Primtive type with the name-string "Primitive", instead of
> "View::Primitive", which is how it was saved in the oldest archives.

Ouch.

> would it be technically possible to add a
> BOOST_CLASS_EXPORT_ALIAS() macro, or some such? If it is possible,
> I'm willing to supply the implementation.

I might be possible by hacking your own copy of extended_type_info.hpp. I
don't think
we'd want to include such thing in the library. So I would suggest:

a) make the hack
b) make small program which loads your old archives and creates new ones.
This should be very easy.
c) Forget this ever happened.

Robert Ramey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk