Re: [Boost-users] Serialising templates with smart pointers....
I think my question is how do I add a serialize method to an interface class, which will invoke the serialize method on the derived sub-class. class Interface { public: virtual void aVirtual() = 0; private: friend class boost::serialization::access; template<class Archive> void serialize(Archive & ar, const unsigned int version) { call serialize on derived class } }; class Derived : Interface virtual void aVirtual() { // Do something } private: friend class boost::serialization::access; template<class Archive> void serialize(Archive & ar, const unsigned int version) { ar & m_data; } }; -- Marcus A.T MacWilliam, Senior Software Engineer. 1Spatial Ltd. Tel: +44 (0)1223 420414, ext 2289, Mob: +44 (0)7803 706597. E-Mail: marcus.macwilliam@1spatial.com Skype:marcus.macwilliam Tennyson House, 7 Cambridge Business Park, Cambridge, CB4 0WZ. Registered in England No. 4785688, VAT Reg. No. 135539408. Website: http://www.1spatial.com/ E-mail: info@1spatial.com
2013/8/7 Marcus MacWilliam
I think my question is how do I add a serialize method to an interface class, which will invoke the serialize method on the derived sub-class.
Try to check the related topic in documentation - http://www.boost.org/doc/libs/1_54_0/libs/serialization/doc/serialization.ht... -- Regards, Stas.
participants (2)
-
Marcus MacWilliam
-
Stanislav Ivochkin