/* * This is a wrapper class which is needed by boost.serialization because it considers strings to be a primitive type. * This causes problems in archiving via pointer. * The solution is to use this type instead of std::string when pointer samatics are used. */ #ifndef tracked_string_H #define tracked_string_H #include class tracked_string { public: tracked_string() {} tracked_string(const std::string& src) { m_string = src; } tracked_string(const tracked_string& src) : m_string(src) {} template void serialize(Archive &ar, unsigned int version) { ar & m_string; } // casting operators operator std::string() const { return m_string; } operator std::string() { return m_string; } private: std::string m_string; // the real data }; #endif