Boost logo

Boost :

From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2006-03-20 12:26:05


Hi all,

I was trying to add class versioning to the serialization code for the Wave
library (for storing macro tables et.al.) but couldn't succeed. I've added a
class version to the code by adding:

namespace boost { namespace serialization {

template<
    typename Iterator, typename LexIterator,
    typename InputPolicy, typename Hooks
>
struct version<boost::wave::context<Iterator, LexIterator, InputPolicy,
Hooks> >
{
    typedef boost::wave::context<Iterator, LexIterator, InputPolicy, Hooks>
        target_type;
    typedef mpl::int_<target_type::version> type; // version == 0x100
    typedef mpl::integral_c_tag tag;
    BOOST_STATIC_CONSTANT(unsigned int, value = version::type::value);
};

}} // namespace boost::serialization

The save function of the context<> now get's called during serialization
with the correct version value. But during load the context<>::load function
still get's passed zero as the loaded version. Is this a known behaviour, am
I ding something wrong (perhaps essential: context is explicitely marked as
'track_never')?

Regards Hartmut


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