cereal
A C++11 library for serialization
|
Casts a derived class to its virtual base class in a way that allows cereal to track inheritance. More...
#include </build/libcereal-1.1.2/include/cereal/types/base_class.hpp>
Public Member Functions | |
template<class Derived > | |
virtual_base_class (Derived const *derived) | |
Public Attributes | |
Base * | base_ptr |
Casts a derived class to its virtual base class in a way that allows cereal to track inheritance.
This should be used in cases when a derived type features virtual inheritance from some base type. This allows cereal to track the inheritance and to avoid making duplicate copies during serialization.
It is safe to use virtual_base_class in all circumstances for serializing base classes, even in cases where virtual inheritance does not take place, though it may be slightly faster to utilize cereal::base_class<> if you do not need to worry about virtual inheritance.