
Very simple case. I just need to know what I'm doing wrong. #include <fstream> #include <boost/archive/text_oarchive.hpp> #include <boost/archive/text_iarchive.hpp> class foo { public: int bar; char *name; template<class Archive> void serialize(Archive &ar, const unsigned int version) { ar & name; } }; void write_foo(foo *f) { ofstream ofs("foo.txt"); { boost::archive::text_oarchive oa(ofs); oa << f; } } The above fails to compile with the following error. /usr/include/boost/serialization/access.hpp:118:9: error: request for member 'serialize' in 't', which is of non-class type 'char' t.serialize(ar, file_version); If I replace the char pointer "name" with the int "foo", it works. Should I be using something other than boost::archive::text_oarchive?