template<typename Enum, typename Storage = std::underlying_type_t<Enum>>
sead::TypedBitFlag class

Public types

using UnderlyingType = std::underlying_type_t<Enum>

Constructors, destructors, conversion operators

TypedBitFlag()
TypedBitFlag(UnderlyingType bits) explicit
TypedBitFlag(Enum bits)
template<typename T>
TypedBitFlag(const TypedBitFlag<Enum, T>& other) explicit

Public functions

template<typename T>
auto operator=(const TypedBitFlag<Enum, T>& other) -> TypedBitFlag&
auto operator=(Enum value) -> TypedBitFlag&
void makeAllZero()
void makeAllOne()
void setDirect(UnderlyingType bits)
void setDirect(Enum bits)
auto getDirect() const -> UnderlyingType
auto getStorage() -> Storage&
auto set(Enum val) -> bool
auto reset(Enum val) -> bool
auto toggle(Enum val) -> UnderlyingType
auto change(Enum val, bool on) -> bool
auto isZero() const -> bool
auto isOn(Enum val) const -> bool
Checks if (at least) one of the bits are set.
auto isAnyOn(std::initializer_list<Enum> list) const -> bool
auto isOnAll(Enum val) const -> bool
Checks if all of the bits are set.
auto isOff(Enum val) const -> bool
auto testAndClear(Enum val) -> bool
auto countOnBit() const -> int
Popcount.
auto countContinuousOffBitFromRight() const -> int
Count trailing zeroes.
auto countRightOnBit(int bit) const -> int
auto findOnBitFromRight(int num) const -> int

Protected static functions

static auto orEnums_(std::initializer_list<Enum> list) -> UnderlyingType constexpr

Protected variables

Storage mBits