#1774 closed Bugs (fixed)
serialization: file written with 1.34.1 can't be read in with 1.35
Reported by: | Owned by: | Matthias Troyer | |
---|---|---|---|
Milestone: | Component: | serialization | |
Version: | Boost 1.35.0 | Severity: | Showstopper |
Keywords: | Cc: |
Description
std::vectors of basic types, saved with 1.34.1, can't be read by 1.35:
simple sample, write file with 1.34.1:
std::vector<unsigned int> vectorToSave; vectorToSave.push_back(0); vectorToSave.push_back(1); vectorToSave.push_back(2);
std::string filename("C:
test1341.xml");{
std::ofstream ofs(filename.c_str()); assert(ofs.good()); boost::archive::xml_oarchive oa(ofs); oa << BOOST_SERIALIZATION_NVP(vectorToSave);
}
And with 1.35:
std::vector<unsigned int> vectorToLoad;
std::string oldfilename("C:
test1341.xml");try{
std::ifstream ifs(oldfilename.c_str()); assert(ifs.good()); boost::archive::xml_iarchive ia(ifs);
restore the schedule from the archive ia >> BOOST_SERIALIZATION_NVP(vectorToLoad);
} catch(...){
std::cout << "\nproblem";
}
This will end up in the catch.
sample output from 1.34:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE boost_serialization> <boost_serialization signature="serialization::archive" version="4"> <vectorToSave>
<count>2</count>
<item_version>0</item_version>
<item>0</item> <item>1</item>
</vectorToSave> </boost_serialization>
sample output from 1.35:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE boost_serialization> <boost_serialization signature="serialization::archive" version="4"> <vectorToSave>
<count>2</count> <item>0</item> <item>1</item>
</vectorToSave> </boost_serialization>
Notice the missing <item_version>0</item_version>
Change History (4)
comment:1 by , 15 years ago
Owner: | changed from | to
---|
comment:2 by , 14 years ago
Milestone: | To Be Determined → Boost 1.35.1 |
---|---|
Status: | new → assigned |
Matias as agreed to help out with this one.
Robert Ramey