how to do performance test using the boost library for a custom library

Okay, so I added serialization to the types (why did you leave it out?) struct X { int p; double q; private: friend boost::serialization::access; template <typename Ar> void serialize(Ar& ar, unsigned) { ar & BOOST_SERIALIZATION_NVP(p); ar & BOOST_SERIALIZATION_NVP(q); } }; struct Y { float m; double n; private: friend boost::serialization::access; template <typename Ar> void serialize(Ar& … Read more

Get private data members for non intrusive boost serialization C++

You can use good old-fashioned friends: Live On Coliru template <typename T> class A { public: A(const T &id) : m_id(id) {} private: template <typename Ar, typename U> friend void boost::serialization::serialize(Ar&,A<U>&,const unsigned); T m_id; }; namespace boost { namespace serialization { template <class Archive, typename T> void serialize(Archive &ar, A<T> &a, const unsigned int) { … Read more