Boost logo

Boost :

From: Matthias Troyer (troyer_at_[hidden])
Date: 2005-10-11 14:41:22


Hi Robert,

Let me just answer a simple point tonight. You'll get my reply to the
rest of the mail in the morning.

On Oct 11, 2005, at 6:45 PM, Robert Ramey wrote:
>
>
>> 3. I had to introduce a new strong typedef in basic_archive.hpp:
>>
>> BOOST_STRONG_TYPEDEF(std::size_t, container_size_type)
>> BOOST_CLASS_IMPLEMENTATION(boost::archive::container_size_type,
>> primitive_type)
>
> I looked at this and right away I noticed that, as written this
> would make
> all existing binary archives unreadable.

Have you looked at the following code I proposed to add for the
binary_iarchives:

     void load_override(container_size_type & t, int){
         // upto 2G objects
         unsigned int x;
         * this->This() >> x;
         t = container_size_type(x);
     }

That, and the similar code for the output archives should do the
trick and keep backward compatibility, or am I mistaken?

However, I fully agree (and actually proposed so myself in the
original mail to do:

> The real fix for is:
>
> a) bump up the library version from 3 to 4
> b) alter save/load collections to use unsigned int or size_t depending
> upon the library version.

but I wanted to leave this to you, since this would be a change to
the binary file format, which I believe should be done by you.

More tomorrow when I'm awake again,

Matthias


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