id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 4044,reset_object_address with library-created objects,Richard Hazlewood,Robert Ramey,"The archive reset_object_address method does not work for objects created by the serialization library. This appears to be the issue as discussed here: http://lists.boost.org/boost-users/2008/11/42417.php It looks like the issue was never addressed. The code below demonstrates. Is this considered to be the desired behaviour? I would've thought the object tracking should be applicable, regardless of how the object is constructed. {{{ #include #include #include #include struct Ob { Ob() : m_(1) {} int m_; template void serialize(A &a, const unsigned) { a & m_; } }; int main(int, char *[]) { std::string serText; { std::ostringstream str; boost::archive::text_oarchive oa(str); Ob *p = new Ob; oa & p & p; // Serialize two instances; serialization lib will track second delete p; serText = str.str(); } { std::istringstream str(serText); boost::archive::text_iarchive ia(str); Ob *p = 0; ia & p; Ob *newp = new Ob(*p); ia.reset_object_address(newp, p); // newp should now be used for future p uses delete p; p = 0; // Let's explicitly get shot of this ia & p; assert(p == newp); // Traps delete newp; } return 0; } }}} ",Bugs,closed,Boost 1.43.0,serialization,Boost 1.42.0,Problem,invalid,reset_object_address heap allocated,