Boost C++ Libraries: Ticket #1774: serialization: file written with 1.34.1 can't be read in with 1.35 https://svn.boost.org/trac10/ticket/1774 <p> std::vectors of basic types, saved with 1.34.1, can't be read by 1.35: </p> <p> simple sample, write file with 1.34.1: </p> <blockquote> <p> std::vector&lt;unsigned int&gt; vectorToSave; vectorToSave.push_back(0); vectorToSave.push_back(1); vectorToSave.push_back(2); </p> </blockquote> <p> </p> <blockquote> <p> std::string filename("C:<br />test1341.xml"); </p> <blockquote> <p> { </p> <blockquote> <p> std::ofstream ofs(filename.c_str()); assert(ofs.good()); boost::archive::xml_oarchive oa(ofs); oa &lt;&lt; BOOST_SERIALIZATION_NVP(vectorToSave); </p> </blockquote> <p> } </p> </blockquote> </blockquote> <p> And with 1.35: </p> <blockquote> <p> std::vector&lt;unsigned int&gt; vectorToLoad; </p> </blockquote> <blockquote> <p> std::string oldfilename("C:<br />test1341.xml"); </p> <blockquote> <p> try{ </p> <blockquote> <p> std::ifstream ifs(oldfilename.c_str()); assert(ifs.good()); boost::archive::xml_iarchive ia(ifs); </p> </blockquote> </blockquote> </blockquote> <blockquote> <blockquote> <blockquote> <p> <em> restore the schedule from the archive ia &gt;&gt; BOOST_SERIALIZATION_NVP(vectorToLoad); </em></p> </blockquote> <p> } catch(...){ </p> <blockquote> <p> std::cout &lt;&lt; "\nproblem"; </p> </blockquote> <p> } </p> </blockquote> </blockquote> <p> This will end up in the catch. </p> <p> sample output from 1.34:<br /> </p> <p> &lt;?xml version="1.0" encoding="UTF-8" standalone="yes" ?&gt; &lt;!DOCTYPE boost_serialization&gt; &lt;boost_serialization signature="serialization::archive" version="4"&gt; &lt;vectorToSave&gt; </p> <blockquote> <p> &lt;count&gt;2&lt;/count&gt; </p> </blockquote> <p> </p> <h2 class="section" id="item_version0item_version">&lt;item_version&gt;0&lt;/item_version&gt;</h2> <blockquote> <p> &lt;item&gt;0&lt;/item&gt; &lt;item&gt;1&lt;/item&gt; </p> </blockquote> <p> &lt;/vectorToSave&gt; &lt;/boost_serialization&gt; </p> <p> sample output from 1.35:<br /> </p> <p> &lt;?xml version="1.0" encoding="UTF-8" standalone="yes" ?&gt; &lt;!DOCTYPE boost_serialization&gt; &lt;boost_serialization signature="serialization::archive" version="4"&gt; &lt;vectorToSave&gt; </p> <blockquote> <p> &lt;count&gt;2&lt;/count&gt; &lt;item&gt;0&lt;/item&gt; &lt;item&gt;1&lt;/item&gt; </p> </blockquote> <p> &lt;/vectorToSave&gt; &lt;/boost_serialization&gt; </p> <p> Notice the missing &lt;item_version&gt;0&lt;/item_version&gt; </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1774 Trac 1.4.3 Robert Ramey Mon, 07 Apr 2008 16:28:59 GMT owner changed https://svn.boost.org/trac10/ticket/1774#comment:1 https://svn.boost.org/trac10/ticket/1774#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Robert Ramey</span> to <span class="trac-author">Matthias Troyer</span> </li> </ul> <p> Matias as agreed to help out with this one. </p> <p> Robert Ramey </p> Ticket Matthias Troyer Fri, 25 Apr 2008 06:25:22 GMT status, milestone changed https://svn.boost.org/trac10/ticket/1774#comment:2 https://svn.boost.org/trac10/ticket/1774#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.35.1</span> </li> </ul> Ticket Matthias Troyer Sat, 14 Jun 2008 20:27:31 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1774#comment:3 https://svn.boost.org/trac10/ticket/1774#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fixed on the trunk </p> Ticket Mon, 03 Nov 2008 14:20:34 GMT milestone deleted https://svn.boost.org/trac10/ticket/1774#comment:4 https://svn.boost.org/trac10/ticket/1774#comment:4 <ul> <li><strong>milestone</strong> <span class="trac-field-deleted">Boost 1.35.1</span> </li> </ul> <p> Milestone Boost 1.35.1 deleted </p> Ticket