Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] class versioning changes in boost 1.42
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-03-01 02:01:36


Robert Ramey wrote:
> Jarl Lindrud wrote:
>> There is definitely a breaking archive format change in
>> basic_binary_iarchive.hpp:110 (1.42.0) - collection sizes serialized
>> as std::size_t rather than unsigned int.

The code in question is:

void load_override(serialization::collection_size_type & t, int){
    if (this->get_library_version() < 6) {
        unsigned int x=0;
        * this->This() >> x;
        t = serialization::collection_size_type(x);
    }
    else {
        std::size_t x=0;
        * this->This() >> x;
        t = serialization::collection_size_type(x);
    }
}

This indicates that if the serialization library version is less than 6,
then
read the collection count as an unsigned int from the file. Otherwise
read the collection count as an std::size_t from the file. Thus, backward
compatibility is maintained through this change.

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