23 #if __cplusplus >= 201703L 25 namespace variantSrc =
std;
27 # include <mpark/variant.hpp> 28 namespace variantSrc = mpark;
31 #include <type_traits> 43 template<
class T_DTYPES,
typename ...
T >
46 static_assert(std::is_enum< T_DTYPES >::value,
"Datatypes to Variant must be supplied as enum.");
49 using resource = variantSrc::variant<
T ... >;
58 : dtype{
static_cast<T_DTYPES
>(r.index())},
68 template<
typename U >
71 return variantSrc::get< U >(m_data);
87 constexpr
size_t index() const noexcept
89 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:57
Generic object to store a set of datatypes in without losing type safety.
Definition: Variant.hpp:44
constexpr size_t index() const noexcept
Retrieve the index of the alternative that is currently been held.
Definition: Variant.hpp:87
Public definitions of openPMD-api.
Definition: Date.cpp:28
resource getResource() const
Retrieve the stored generic object.
Definition: Variant.hpp:78