
30 Dec
2008
30 Dec
'08
4:23 p.m.
I have following class with stl container: class storage : { private: map<const char*, int, cmp> data_; friend class boost::serialization::access; template<class Archive> void save(Archive & ar, const unsigned int version) const { map<string, int> local; constDataIter iter; for (iter = data_.begin(); iter != data_.end(); iter++) { local[iter->first] = iter->second; } ar & local; } } This code works, but it slowly(full copy) and consume too much memory (x2) :-( What is the best serialization strategy with such stl containers or pointer to pod type? I cannot change const char* to string, dont ask me why :-)) Thanks you for any advice.