cereal
A C++11 library for serialization
|
A class used to disambiguate cases where cereal cannot detect a unique way of serializing a class. More...
#include </home/shane/workspace/cereal/include/cereal/specialize.hpp>
Related Functions | |
(Note that these are not member functions.) | |
enum | specialization |
A class used to disambiguate cases where cereal cannot detect a unique way of serializing a class.
cereal attempts to figure out which method of serialization (member vs. non-member serialize or load/save pair) at compile time. If for some reason cereal cannot find a non-ambiguous way of serializing a type, it will produce a static assertion complaining about this.
This can happen because you have both a serialize and load/save pair, or even because a base class has a serialize (public or private with friend access) and a derived class does not overwrite this due to choosing some other serialization type.
Specializing this class will tell cereal to explicitly use the serialization type you specify and it will not complain about ambiguity in its compile time selection. However, if cereal detects an ambiguity in specializations, it will continue to issue a static assertion.
You can also choose to use the macros CEREAL_SPECIALIZE_FOR_ALL_ARCHIVES or CEREAL_SPECIALIZE_FOR_ARCHIVE if you want to type a little bit less.
T | The type to specialize the serialization for |
S | The specialization type to use for T |