Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10740: Multi-level containers do not cooperate with address tracking
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-11-27 18:19:57
#10740: Multi-level containers do not cooperate with address tracking
-------------------------------------+-------------------------------------
Reporter: Simon Etter | Owner: ramey
<ettersi@â¦> | Status: closed
Type: Bugs | Component: serialization
Milestone: To Be Determined | Severity: Problem
Version: Boost 1.56.0 | Keywords: Address tracking, STL
Resolution: invalid | containers
-------------------------------------+-------------------------------------
Comment (by ramey):
"To my understanding, Boost.Serialization wishes to maintain the invariant
that if a pointer pointed to an object before the
serialization/deserialization process, it also does so afterwards."
nope. loading an object serialized through a pointer creates a NEW
pointer which is "equivalent" to the old one. It's equivalent in that it
points to a new and disjoint versions of the original.
{{{
// Again, we would like pd to point to the dummy object,
independent
// of where it is loaded. This is not the case, however.
assert(&l.back().back() == pd); // Does fire!!!
}}}
Nope: we expect pd to point to some new object - disjoint but equivalent
to the original one.
{{{
// Again, let pd point to the dummy object
dummy* pd = &l.back().back();
// Same as before...
{
std::ofstream ofs("two_level.xml");
boost::archive::xml_oarchive oa(ofs);
oa << BOOST_SERIALIZATION_NVP(l) <<
BOOST_SERIALIZATION_NVP(pd);
}
dummy* pd1;
{
std::ifstream ifs("two_level.xml");
boost::archive::xml_iarchive ia(ifs);
ia >> BOOST_SERIALIZATION_NVP(l) >>
BOOST_SERIALIZATION_NVP(pd1);
}
assert(*pd == *pd1); // should be true
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10740#comment:3> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC