Jump to content
  • Advertisement
Sign in to follow this  

More problems with boost again...

This topic is 4833 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

OK, in my other post where I when on about not being able to serialize char*, I gave up and used std::string (I'm sure there's a way to a support for char*). Anyway I am having problems with splitting intrusive serialize methods when using STL containers in MSVC++ 7.1 look at ... class P { private: int qw; friend class boost::serialization::access; template<class Archive> void serialize(Archive& ar, const unsigned int version) { ar & qw; } public: P() : qw(0) {} P(int Qw) : qw(Qw) {} }; typedef std::list<P*> pList; class Test { pList p; friend class boost::serialization::access; BOOST_SERIALIZATION_SPLIT_MEMBER() template<class Archive> void load(Archive& ar, const unsigned int version) { ar & p; } template<class Archive> void save(Archive& ar, const unsigned int version) const { ar & p; } public: Test() {} }; If anyone tries to write this to an archive using something like ... Test t; std::ofstream ofs("frameTest"); boost::archive::text_oarchive oa(ofs); oa << t; ofs.close(); then I get .\boost_1_32_0\boost\serialization\split_free.hpp(45): error C2780: 'void boost::archive::save(Archive &,const T &)' : expects 2 arguments - 3 provided Now if I remove the load/save spliting and use a normal serialize method, this compiles fine. However I need separated load/save methods as the class I am using this on deals with SDL resources / structures. As a result I need to make it so my load method does special things to load surfaces for a little arcade game I'm working on. Could someone confirm this is a bug / issue with boost and not something dumb I'm missing out on. I've only been coding in C++ for the last month, and come from a PHP / Web programming background, so I'm still getting used to the change.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!