mirror of
https://github.com/RPCS3/cereal.git
synced 2025-02-20 15:52:58 +00:00
Fixing static_assert messages
This commit is contained in:
parent
f8502c368c
commit
d82ecd7b63
@ -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<class Archive>\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<class Archive>\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;
|
||||
}
|
||||
|
@ -62,7 +62,6 @@ namespace cereal
|
||||
template<class T, class Archive> 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 );
|
||||
}
|
||||
};
|
||||
|
10
sandbox.cpp
10
sandbox.cpp
@ -64,13 +64,15 @@ class Test2
|
||||
template<class Archive>
|
||||
void save(Archive & ar) const
|
||||
{
|
||||
ar(CEREAL_NVP(a));
|
||||
ar(a);
|
||||
//ar(CEREAL_NVP(a));
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
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);//
|
||||
|
Loading…
x
Reference in New Issue
Block a user