File variant.hxx¶
Defines
-
__VARIANT_HXX__
¶ Variant utilities
All in namespace bout::utils variant visit holds_alternative get
variantEqualTo variantStaticCastOrThrow variantToString
Internal implementation in bout::utils::details
-
namespace
bout
SNB model
-
namespace
utils
Functions
-
template<typename
Variant
, typenameT
>
boolvariantEqualTo
(const Variant &v, const T &t)¶ Return true only if the given variant
v
has the same type and value ast
Note: Handles the case that
t
is not of a type which can hold.
-
namespace
details
-
template<typename
T
, typenameU
>
structCompareTypes
¶ - #include <variant.hxx>
Compare two values. Different types -> false
Public Functions
-
bool
operator()
(const T &v, const U &t)¶
-
bool
-
template<typename
T
>
structCompareTypes
<T, T>¶ - #include <variant.hxx>
Compare two values Same type -> use
==
operator to comparePublic Functions
-
bool
operator()
(const T &v, const T &t)¶
-
bool
-
template<typename
T
>
structIsEqual
¶ - #include <variant.hxx>
A visitor for std::variant which compares the value stored in the variant with a given value using CompareTypes
Public Members
-
const T &
t
¶
-
const T &
-
template<typename
Target
>
structStaticCastOrThrow
¶ - #include <variant.hxx>
Functor to perform static casting with std::visit If the Target cannot be constructed from the Source then an exception (std::bad_cast) will be thrown at run time.
Note: This needs to be at runtime because the particular type which a variant is holding is only known at runtime.
-
struct
ToString
¶
-
template<typename
-
template<typename
-
namespace