I am using the boost example code to store a vector of pointers of objects in a file. My vector is:
class VOMC{
public:
vector<State*> vomc;
...
...
private:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
ar & vomc;
}
}
This gives me the following error(among few more):
/usr/local/include/boost/serialization/access.hpp:118:9: error: ‘class State’ has no member named ‘serialize’
The error makes is probably telling me that I should also make my State object serializable(not sure on that one). Furthermore, I am confused because storing the pointers(addresses to memory) does not store the actual data, which will be freed upon program termination. Is there a workaround for the above situation? Even without boost.
You need
serialize
method for yourState
class.http://www.boost.org/doc/libs/1_51_0/libs/serialization/doc/index.html
Also i think you should read about serialization of pointers