Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost.Serialization] (De-)serialization with class versioning
From: Robert Ramey (ramey_at_[hidden])
Date: 2018-03-11 19:37:53


On 3/11/18 11:41 AM, Robert Ramey via Boost-users wrote:
> On 3/11/18 9:44 AM, Lars Ruoff via Boost-users wrote:
>> Ok, i realized my mistake:
>> I explicitly called the top level serialization functions giving it
>> the hard-coded version numbers, like:
>
> You should never, ever call the serialize function from a user program.
> This should be called by the serialization libary and only the
> serialization library.  If you find yourself doing this, you are making
> an error and misunderstanding in some way how the library is meant to be
> used.

FYI - I recommend making the intrusive serialize functions private.
Then using friend to give the serialization library - and only the
serialization library - access to them. This makes it much harder to
accidentally misuse the library. Of course this gives no help for
non-intrusive serialize functions.

Robert Ramey


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