|
Boost : |
Subject: [boost] Boost.Serialization issue loading 1.37 binary archive.
From: Brandon Kohn (blkohn_at_[hidden])
Date: 2011-04-01 14:54:53
Hello,
I've been using Boost.Serialization for some time, and have found a
break while upgrading to 1.46.1 (from 1.37). The problem seems to be the
size of the integral type which stores
v. 1.37 has:
BOOST_ARCHIVE_VERSION(){
return 5;
}
When saving to the binary_oarchive:
// basic_binary_oarchive.hpp
void save_override(const class_id_type & t, int){
// upto 32K classes
const int_least16_t x = t.t;
* this->This() << x;
}
1.46.1 has:
void load_override(class_id_type & t, int version){
library_version_type lvt = this->get_library_version();
if(boost::archive::library_version_type(7) < lvt){
this->detail_common_iarchive::load_override(t, version);
}
else
if(boost::archive::library_version_type(6) < lvt){
int_least16_t x=0;
* this->This() >> x;
t = boost::archive::class_id_type(x);
}
else{
int x=0;
* this->This() >> x;
t = boost::archive::class_id_type(x);
}
}
The salient point is that on the load in 1.46.1 an int is used to read
the value which was stored as int_least16_t in version 5 archives. The
trunk seems to have this as well.
Regards,
Brandon Kohn
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk