[Serialization] Error in serialization of a hash map

Hi,
I'm having a bit of trouble while using the serialization library. (Boost v1.35, gcc, Red Hat Linux).
I have a class containing a hash_map (key=string, value=shared_ptr to a class containing a deque):
HashMapClass{
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive &ar, const unsigned in t version){
ar & map;
}
__gun_cxx::hash_map

I don't think that serialization of maps which containers is reliable.
The problem has to do with the fact that data is loaded then moved
and the "reset object address" function can't keep track of it.
For a truely reliable method, I would recommend putting your map into
some other container before serializing it and building the map after
loading it.
Robert Ramey
"Jack Mullen"
participants (2)
-
Jack Mullen
-
Robert Ramey