diff --git a/include/cereal/cereal.hpp b/include/cereal/cereal.hpp index 11b2234b..a923e63c 100644 --- a/include/cereal/cereal.hpp +++ b/include/cereal/cereal.hpp @@ -255,9 +255,9 @@ namespace cereal "Types must either have a serialize function, or separate save/load functions (but not both).\n" "Serialize functions generally have the following signature:\n\n" "template\n" - " void serialize(int & ar)\n" + " void serialize(Archive & ar)\n" " {\n" - " ar & member1 & member2 & member3;\n" + " ar( member1, member2, member3 );\n" " }\n\n" ); return *self; } @@ -396,9 +396,9 @@ namespace cereal "Types must either have a serialize function, or separate save/load functions (but not both).\n" "Serialize functions generally have the following signature:\n\n" "template\n" - " void serialize(int & ar)\n" + " void serialize(Archive & ar)\n" " {\n" - " ar & member1 & member2 & member3;\n" + " ar( member1, member2, member3 );\n" " }\n\n" ); return *self; } diff --git a/include/cereal/details/traits.hpp b/include/cereal/details/traits.hpp index 649ad53a..d0abf5fb 100644 --- a/include/cereal/details/traits.hpp +++ b/include/cereal/details/traits.hpp @@ -62,7 +62,6 @@ namespace cereal template inline static auto load_and_allocate(Archive & ar) -> decltype(T::load_and_allocate(ar)) { - std::cout << "yo2" << std::endl; return T::load_and_allocate( ar ); } }; diff --git a/sandbox.cpp b/sandbox.cpp index 8df57b6a..db244100 100644 --- a/sandbox.cpp +++ b/sandbox.cpp @@ -64,13 +64,15 @@ class Test2 template void save(Archive & ar) const { - ar(CEREAL_NVP(a)); + ar(a); + //ar(CEREAL_NVP(a)); } template void load(Archive & ar) { - ar(CEREAL_NVP(a)); + ar(a); + //ar(CEREAL_NVP(a)); } }; @@ -220,10 +222,13 @@ int main() e_out.t4 = {4}; e_out.s = "Hello, World!"; + Test2 t2 = {22}; + { std::ofstream os("out.txt"); cereal::BinaryOutputArchive archive(os); archive(CEREAL_NVP(e_out)); + archive(t2); } Everything e_in; @@ -232,6 +237,7 @@ int main() std::ifstream is("out.txt"); cereal::BinaryInputArchive archive(is); archive(CEREAL_NVP(e_in)); + archive(t2); } assert(e_in == e_out);//