23 #include "VariantSrc.hpp" 25 #include <type_traits> 37 template<
class T_DTYPES,
typename ...
T >
40 static_assert(std::is_enum< T_DTYPES >::value,
"Datatypes to Variant must be supplied as enum.");
43 using resource = variantSrc::variant<
T ... >;
52 : dtype{
static_cast<T_DTYPES
>(r.index())},
62 template<
typename U >
65 return variantSrc::get< U >(m_data);
81 constexpr
size_t index() const noexcept
83 return m_data.index();
Variant(resource r)
Construct a lightweight wrapper around a generic object that indicates the concrete datatype of the s...
Definition: Variant.hpp:51
Generic object to store a set of datatypes in without losing type safety.
Definition: Variant.hpp:38
constexpr size_t index() const noexcept
Retrieve the index of the alternative that is currently been held.
Definition: Variant.hpp:81
Public definitions of openPMD-api.
Definition: Date.cpp:29
resource getResource() const
Retrieve the stored generic object.
Definition: Variant.hpp:72