Template Class flags¶
Defined in File flags.hpp
Class Documentation¶
-
template<class Enum, class EnumUnderlyingType = int32_t>
class util::flags¶ A helper for storing an OR-combination of enum values.
- tparam Enum
the used enum
- tparam EnumUnderlyingType
the enum’s underlying type, 32-bit integer by default
Public Functions
-
flags(std::initializer_list<Enum> values)¶
Constructs a flags object initialized with the flags from the initializer_list OR’d together.
-
flags() = default¶
-
~flags() = default¶
-
explicit operator EnumUnderlyingType() const¶
Casts to the underlying type of this enum.
Can be used if the value needs to be supplied to library functions or else.
-
explicit operator bool() const noexcept¶
Returns true if the flag is set to a value or false if not.
-
auto operator!() const noexcept -> bool¶
Returns true if the flag is not set to a value or false if it is.
-
void reset() noexcept¶
Resets all flag values.