23 Dec
2005
23 Dec
'05
4:18 a.m.
Merrill Cornish wrote:
// save data to archive ofstream outStream(archiveFile); boost::archive::xml_oarchive outArchive(outStream);
// write class instance to archive outArchive << testObj_out;
try this instead: outArchive << BOOST_SERIALIZATION_NVP(testObj_out);
} // archive and stream closed when destructors are called
Succ* testObj_in = new Succ(); { // create and open an archive for input ifstream inStream(archiveFile); boost::archive::xml_iarchive inArchive(inStream);
// read class state from archive inArchive >> testObj_in;
and here as well inArchive >> BOOST_SERIALIZATION_NVP(testObj_in);
} // archive and stream closed when destructors are called return; }//run() }//MyNS