Boost logo

Boost Users :

From: Jeff Epler (jepler_at_[hidden])
Date: 2006-10-03 11:50:00


Please send me a copy of any replies to this message.

The following code compiles with boost_1_31_0 but fails with 1_32_0 and
1_33_1 (tested with gcc 3.2.2 and gcc 4.0.3 on Linux systems):

// -------------------------------------------------------------------
#include <boost/archive/xml_iarchive.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/serialization/split_member.hpp>
#include <iostream>

struct K {
    friend class boost::serialization::access;
    template<class Archive>
        void save(Archive &ar, const unsigned int version) const
        {}
    template<class Archive>
        void load(Archive &ar, const unsigned int version)
        {}
    BOOST_SERIALIZATION_SPLIT_MEMBER()
};

struct load { int x; };

int main(void) {
    std::vector<K> v;
    boost::archive::xml_iarchive ia( std::cin );
    ia & boost::serialization::make_nvp("v", v);
    return 0;
}
// -------------------------------------------------------------------

We would like to move our application from boost 1_31 but this problem
with 'struct load' has stopped us so far.

Is this a bug in BOOST serialization in 1_32 and 1_33 that will be
corrected in the future, or do we have no choice but to rename our
'struct load'? If this is the correct behavior of the serialization
library, is it noted anywhere in the documentation? I was unable to
find such a note.

Jeff


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