Subject: Re: [Boost-bugs] [Boost C++ Libraries] #1942: Pointers to elements in a std::map are not serilaized correctly
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-06-08 20:49:29
#1942: Pointers to elements in a std::map are not serilaized correctly
-------------------------------------+--------------------------------------
Reporter: bernhard.maeder_at_[hidden] | Owner: ramey
Type: Bugs | Status: closed
Milestone: To Be Determined | Component: serialization
Version: Boost 1.35.0 | Severity: Problem
Resolution: wontfix | Keywords:
-------------------------------------+--------------------------------------
Changes (by ramey):
* status: new => closed
* resolution: => wontfix
Comment:
After a lot of work, I managed to discover what the problem is.
The following case will fail when all three of the following are true:
a) object is untracked (map<>::value_type in your case
b) object contains something else that is tracked
c) The containing object is moved after being deserialized - load a map
has to do.
In your case this can be address by adding:
namespace boost { \
namespace serialization { \
template<> \
struct tracking_level< std::map<std::size_t, dummy>::value_type >
\
{ \
typedef mpl::integral_c_tag tag; \
typedef mpl::int_< boost::serialization::track_always > type;
\
BOOST_STATIC_CONSTANT( \
int, \
value = tracking_level::type::value \
); \
};
}
}
I haven't found any general solution. I'll add a note to the
documentation.
Robert Ramey
--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1942#comment:2>
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:49:58 UTC