23 #include "VariantSrc.hpp"
26 #include <type_traits>
38 template<
class T_DTYPES,
typename ...
T >
41 static_assert(std::is_enum< T_DTYPES >::value,
"Datatypes to Variant must be supplied as enum.");
44 using resource = variantSrc::variant<
T ... >;
53 : dtype{
static_cast<T_DTYPES
>(r.index())},
63 template<
typename U >
66 return variantSrc::get< U >(m_data);
82 constexpr
size_t index() const noexcept
84 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:52
U get() const
Retrieve a stored specific object of known datatype with ensured type-safety.
Definition: Variant.hpp:64
constexpr size_t index() const noexcept
Retrieve the index of the alternative that is currently been held.
Definition: Variant.hpp:82
Public definitions of openPMD-api.
Definition: Date.cpp:29
resource getResource() const
Retrieve the stored generic object.
Definition: Variant.hpp:73
Generic object to store a set of datatypes in without losing type safety.
Definition: Variant.hpp:39