Boost logo

Boost :

From: Zach Laine (whatwasthataddress_at_[hidden])
Date: 2007-03-20 14:45:45


On 3/20/07, Janek Kozicki <janek_listy_at_[hidden]> wrote:
> Robert Ramey said: (by the date of Mon, 19 Mar 2007 08:51:12 -0800)
>
> > So its not that I'm really opposed in principle,
> > I just don't want to start mucking things up
> > to deal with one unusual case which
> > is the result of programmer error.
>
> Robert, think about code refactoring, not about programmer's error.
>
> My biggest application (yade, you heard about it already) is
> constantly evolving, changing the class names is an important part of
> that evolution.
>
> Of course alternative solution, as Emil suggests, is not to change
> boost::serialization, but to register the classes manually (with
> manually chosen identifier string). But then we at least need a
> BIG FAT warning in the documentation regarding the use of
> BOOST_CLASS_EXPORT, and a possible pitfall: code refactoring loses
> archive compatibility.
>
> Anyway, we will see if changes proposed by Zach will produce that
> ripple effect of small modifications, and the decide on what to do :)

I've attached a patchfile against 1.33.1 that introduces a
BOOST_CLASS_EXPORT_ALIAS() macro and a test program that shows that it
works. In the test program, initially leave the #define SAVING 1 in
place, compile, and execute to create a binary archive. Then #define
SAVING 0, compile and execute to read the same archive in using the
archived classes in a different namespace. This should blow up, as
expected, since it doesn't use the new macro. Finally, #define
EXPORT_ALIASES 1, and the archive should load using the aliases that
include the old namespace.

I'll wait to add anything further to the discussion until Robert has
seen the changes and decides whether they are acceptible or need to be
adjusted.

Zach Laine





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