|
Boost Users : |
Subject: Re: [Boost-users] [repost][serialization] version handling in {save|load}_construct_data
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2010-01-09 20:01:59
On Sat, Jan 9, 2010 at 11:19 AM, JOAQUIN M. LOPEZ MUÃOZ <joaquin_at_[hidden]> wrote:
> Hello, allow me to repost this message from a couple of
> weeks ago:
>
> I've taken a look at how the version number is dealt with
> in Boost.Serialization collection serialization code:
>
> * The relevant code at saving time is:
>
> Â Â Â if(3 < ar.get_library_version()){
> Â Â Â Â Â Â Â const unsigned int item_version = version<
> Â Â Â Â Â Â Â Â Â Â Â BOOST_DEDUCED_TYPENAME Container::value_type
> Â Â Â Â Â Â Â >::value;
> Â Â Â Â Â Â Â ar << BOOST_SERIALIZATION_NVP(item_version);
> Â Â Â }
>
> * At loading time, the equivalent code is:
> Â Â Â unsigned int item_version;
> Â Â Â ar >> BOOST_SERIALIZATION_NVP(count);
> Â Â Â if(3 < ar.get_library_version())
> Â Â Â Â Â Â Â ar >> BOOST_SERIALIZATION_NVP(item_version);
> Â Â Â else
> Â Â Â Â Â Â Â item_version = 0;
> Can someone (aka Robert :-) ) shed some light on this bit?
> Why the version number has to be given such manual processing
> when this is not needed if, for instance, serializating
> values via the simple ar&value?
> I'm trying to do the equivalent thing in Boost.MultiIndex.
>
> Thank you,
>
> JoaquÃn M López Muñoz
> Telefónica, Investigación y Desarrollo
For note, your email was a big black blob on my black background. If
you are going to specify a text color (black in your case), make sure
you specify a background color (transparent in your case, which on my
black background makes your text invisible). Better to just send as
pure text anyway.
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