Sorry for cross-registration. After you sent to the user mailing list and one week without any answers, I tend to post this issue on stackoverflow. Original post, slightly edited:
Hi,
I am upgrading from Boost v1.35 to the new version. However, I have some deprecated serialized strings that I want to read in the new version.
After some testing, I found that, apparently, a newer version (in this case 1.40, but also later) could not correctly deserialize std :: vector instances from 1.35 generated lines. Can someone give my pointer as to what might be the problem here?
Thanks a lot!
Ewald
== Details ==
I use text archives and gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9)
A test vector is a structure with two elements, long integers 1 and 2.
Archive line for the corresponding lib versions:
1.35: archive: 22 serialization::archive 4 2 1 2
1.40: archive: 22 serialization::archive 5 2 0 1 2
Now:
// includes #include <boost/serialization/vector.hpp> #include <boost/archive/text_iarchive.hpp> #include <boost/archive/text_oarchive.hpp> std::vector<long> testvector; std::string val = "22 serialization::archive 4 2 1 2"; // v1.35 archive { std::stringstream ss(std::stringstream::in | std::stringstream::out); ss << val << std::endl; boost::archive::text_iarchive ia(ss); ia >> BOOST_SERIALIZATION_NVP(testvector); }
The result when executed with lib v1.40: testvector contains two elements, {2, 2} - instead of {1, 2}
Note: s11n and de-s11n with the same lib version work fine.
source share