22 Sep
2008
22 Sep
'08
3:16 p.m.
When using a stringstream in binary mode along with the non-portable binary archive occasionally I see the serialization code throw bad_alloc when reconstructing an object. It appears to be when trying to serialize a derived stl map. We derive from std::map in our project to add a few more convenience methods and a simpler interface and I then added the following code to serialize this newly derived type: template<class Archive> void serialize(Archive &p_archiver, foobar::ResourceMap &p_map, const unsigned int version) { p_archiver & base_object