#include #include #include #include #include #include #include #include #include using namespace std; class Foo { public: string s; Foo() {} Foo(string s): s(s) {} Foo(const Foo& other) = delete; Foo &operator=(const Foo &other) = delete; Foo(Foo &&other) noexcept = default; Foo &operator=(Foo &&other) noexcept = default; template void save(Archive &ar, const unsigned int version) const { ar & this->s; } template void load(Archive &ar, const unsigned int version) { ar & this->s; } BOOST_SERIALIZATION_SPLIT_MEMBER() friend class boost::serialization::access; }; int main(int argc, char *argv[]) { vector> bar; const char* text_file_name = "/tmp/test-fixed-multibit.txt"; { std::ofstream ofs(text_file_name); boost::archive::text_oarchive ar(ofs); ar & bar; } { vector> bar1; std::ifstream ifs(text_file_name); boost::archive::text_iarchive ar(ifs); ar & bar1; } return 0; }