#include "B.hpp" #include #include #include B::B(const std::string& s, float f) : foo(s), bar(f) {} B_DECL void load(B& b) { std::ifstream ifs("b.xml"); boost::archive::xml_iarchive ia(ifs); ia >> BOOST_SERIALIZATION_NVP(b); } B_DECL void save(const B& b) { std::ofstream ofs("b.xml"); boost::archive::xml_oarchive oa(ofs); oa << BOOST_SERIALIZATION_NVP(b); //or just b.bar also fails }