Functions
-
template <typename E, E V>bool IsValidEnum ()Check if |V| is a valid enum value of type E.
This uses the compiler's __PRETTY_FUNCTION__ feature: For non-enum values,
the value of __PRETTY_FUNCTION__ looks like:
"constexpr bool IsValidEnum() [with E = Enum; E V = (Enum)0]"
However, for defined enum values, the value looks like:
"constexpr bool IsValidEnum() [with E = Enum; E V = Enum::IDENTIFIER]"
We can check whether if the value of |V| is displayed as an identifier in the
__PRETTY_FUNCTION__ string to know whether it is a valid enum value.
Defined at line 59 of file ../../src/ui/lib/escher/third_party/enum_utils/enum_utils.h
-
template <typename E, auto Begin, auto Offset>bool IsValueValidEnum ()Helper function check if |Begin + Offset| is a valid enum value in |E|.
Defined at line 77 of file ../../src/ui/lib/escher/third_party/enum_utils/enum_utils.h
-
template <typename E, auto Begin, auto... Ints>size_t CountEnumElementInSequence (std::integer_sequence<decltype(Begin), Ints...> seq)Helper function counting all the valid enum values in integer sequence
{Begin, Begin + 1, ..., Begin + Ints.size() - 1}.
Defined at line 84 of file ../../src/ui/lib/escher/third_party/enum_utils/enum_utils.h
-
template <typename E, auto Min, auto... Ints>std::optional<decltype(Min)> MaxEnumElementInSequence (std::integer_sequence<decltype(Min), Ints...> seq)Helper function finding the maximum enum values in integer sequence
{Begin, Begin + 1, ..., Begin + Ints.size() - 1}.
Returns std::nullopt if none of the values is valid in the sequence.
Defined at line 93 of file ../../src/ui/lib/escher/third_party/enum_utils/enum_utils.h
-
template <typename Eauto Minauto... Ints>std::optional<decltype(Min)> MinEnumElementInSequence (std::integer_sequence<decltype(Min), Ints...> seq)Helper function finding the minimum enum values in integer sequence
{Begin, Begin + 1, ..., Begin + Ints.size() - 1}.
Returns std::nullopt if none of the values is valid in the sequence.
Defined at line 109 of file ../../src/ui/lib/escher/third_party/enum_utils/enum_utils.h