23 #include "VariantSrc.hpp" 26 #include <type_traits> 39 template <
class T_DTYPES,
typename...
T>
43 std::is_enum<T_DTYPES>::value,
44 "Datatypes to Variant must be supplied as enum.");
47 using resource = variantSrc::variant<
T...>;
55 Variant(resource r) : dtype{
static_cast<T_DTYPES
>(r.index())}, m_data{r}
68 return variantSrc::get<U>(m_data);
84 constexpr
size_t index() const noexcept
86 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:55
Generic object to store a set of datatypes in without losing type safety.
Definition: Variant.hpp:40
constexpr size_t index() const noexcept
Retrieve the index of the alternative that is currently been held.
Definition: Variant.hpp:84
Public definitions of openPMD-api.
Definition: Date.cpp:28
resource getResource() const
Retrieve the stored generic object.
Definition: Variant.hpp:75