![]() |
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
Recursive variant implementation. More...
#include <Variant.hpp>
Inheritance diagram for ScriptInterface::impl::recursive_variant< Ts >:
Collaboration diagram for ScriptInterface::impl::recursive_variant< Ts >:Public Types | |
| using | BaseClass = recursive_variant_add_containers< Ts... > |
| template<class T > | |
| using | has_type = std::disjunction< std::is_same< T, Ts >... > |
| Is a given type part of this variant's type list. | |
Friends | |
| class | boost::serialization::access |
Recursive variant implementation.
This boilerplate code is required to emulate the following Boost feature:
C++ doesn't natively supports the kind of reflections needed to implement this behavior. Our implementation splits the definition in two classes: a forward-declared recursive_variant template class whose type parameters are "basic" types (i.e. non-recursive types), and a helper class recursive_variant_add_containers that injects carefully chosen STL containers into the type list. Since STL containers store a pointer to a buffer holding variant instances, the variant size doesn't need to be known at the time the variant is defined, and the variant is recursive.
Definition at line 84 of file Variant.hpp.
| using ScriptInterface::impl::recursive_variant< Ts >::BaseClass = recursive_variant_add_containers<Ts...> |
Definition at line 85 of file Variant.hpp.
| using ScriptInterface::impl::recursive_variant< Ts >::has_type = std::disjunction<std::is_same<T, Ts>...> |
Is a given type part of this variant's type list.
Definition at line 89 of file Variant.hpp.
Definition at line 92 of file Variant.hpp.