Try the following change - If this does it - read the rationale about using const with serialization. Robert Ramey Joseph Turian wrote:
Hi Robert and everyone,
Thank you for explaining to me about BOOST_STRONGTYPE. I'll let you know how that goes for me. And thank you for being so patient and trying to help me get serialization working in my program.
In the meantime, I'm experiencing a much simpler problem. Although I can serialize classes of the form boost::shared_ptr<T>, where T is a class I've defined, I get compilation errors if I try to serialize a boost::shared_ptr<int>.
How can I resolve this?
Code snippet: ----------------------------------------------- #include <iostream> #include <fstream>
#include
#include #include #include #include #include int main() { std::ofstream ofs("archive"); boost::archive::text_oarchive oa(ofs);
//boost::shared_ptr<int> i; const boost::shared_ptr<int> i; oa << i;
return 0; } -----------------------------------------------