|
Boost Users : |
From: Robert Ramey (ramey_at_[hidden])
Date: 2007-08-18 00:37:06
let me know if the following doesn't work
Robert Ramey
Hector C. wrote:
#include <fstream>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
//#include <string> // remove this
#include <boost/serialization/string.hpp> // use this instead !!!
using namespace std;
class A
{
public:
string m;
A(){};
private:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
ar & m;
}
};
int main(int argc, char * argv[])
{
cosnt A a; // note "const" here
{
ofstream off("test.txt");
boost::archive::text_oarchive oa(off);
oa << a;
}
return 0;
}
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net