cereal
cereal copied to clipboard
CEREAL_REGISTER_TYPE bind T to Archive fail, when father class and son class serialize function is not the same type of function(merber or no merber))
struct A {
int a
template <class Archive>
void serialize(Archive &ar) {
ar(a);
}
}
struct B : struct A {
int b
}
template <class Archive>
void serialize(Archive &ar, B& data) {
ar(cereal::base_class<A>(&data),data.b);
}
CEREAL_REGISTER_TYPE(B);
CEREAL_REGISTER_POLYMORPHIC_RELATION(ObjectParam, VideoObjectParam);
When the serialization function of A is non_member and the serialization function of B is member OR the serialization function of A is member and the serialization function of B is non_member, bind B to Archive fail.
template <class T, class InputArchive>
struct is_input_serializable : std::integral_constant<bool,
detail::count_input_serializers<T, InputArchive>::value == 1> {};
When I review the source code, I find the serialization function could only be one:detail::count_input_serializers<T, InputArchive>::value == 1
您的邮件我已收到,谢谢合作!