38 template <
class T_DTYPES,
typename... variant_types>
42 std::is_enum<T_DTYPES>::value,
43 "Datatypes to Variant must be supplied as enum.");
54 Variant(from_basic_type_tag, U);
56 Variant(from_any_tag, std::any);
77 [[nodiscard]] U
const &
get()
const;
83 template <
typename variant_t>
86 return *std::any_cast<variant_t>(&m_data);
89 [[nodiscard]] std::any
const &getAny()
const
98 [[nodiscard]]
size_t index()
const;
110 template <
class... Ts>
113 using Ts::operator()...;
115 template <
class... Ts>
Generic object to store a set of datatypes in without losing type safety.
Definition Variant.hpp:40
U const & get() const
Retrieve a stored specific object of known datatype with ensured type-safety.
variant_t const & getVariant() const
Retrieve the stored generic object.
Definition Variant.hpp:84
Variant(U u)
Construct a lightweight wrapper around a generic object that indicates the concrete datatype of the s...
Definition Variant.cpp:52
size_t index() const
Retrieve the index of the alternative that is currently been held.
Definition Variant.cpp:66
Public definitions of openPMD-api.
Definition Date.cpp:29
Definition Variant.hpp:51
Definition Variant.hpp:47
Definition Variant.hpp:112