StormByte 2.0.0
C++26 foundation of the StormByte suite
 
Loading...
Searching...
No Matches
bitmask.hxx File Reference
Include dependency graph for bitmask.hxx:

Go to the source code of this file.

Classes

class  StormByte::Bitmask< Derived, E >
 CRTP wrapper that stores an unsigned enum as a flag set. More...
 

Namespaces

namespace  StormByte
 Root namespace of the StormByte suite.
 

Functions

template<Type::UnsignedEnum E>
constexpr E operator| (E a, E b) noexcept
 Bitwise OR for unsigned scoped enumerations.
 
template<Type::UnsignedEnum E>
constexpr E operator& (E a, E b) noexcept
 Bitwise AND for unsigned scoped enumerations.
 
template<Type::UnsignedEnum E>
constexpr E operator^ (E a, E b) noexcept
 Bitwise XOR for unsigned scoped enumerations.
 
template<Type::UnsignedEnum E>
constexpr E operator~ (E a) noexcept
 Bitwise NOT for unsigned scoped enumerations.
 

Function Documentation

◆ operator&()

template<Type::UnsignedEnum E>
constexpr E operator& ( E  a,
E  b 
)
constexprnoexcept

Bitwise AND for unsigned scoped enumerations.

Template Parameters
EEnumeration type (Type::UnsignedEnum).
Parameters
aLeft operand.
bRight operand.
Returns
E with bits of a and b.

◆ operator^()

template<Type::UnsignedEnum E>
constexpr E operator^ ( E  a,
E  b 
)
constexprnoexcept

Bitwise XOR for unsigned scoped enumerations.

Template Parameters
EEnumeration type (Type::UnsignedEnum).
Parameters
aLeft operand.
bRight operand.
Returns
E with bits of a xor b.

◆ operator|()

template<Type::UnsignedEnum E>
constexpr E operator| ( E  a,
E  b 
)
constexprnoexcept

Bitwise OR for unsigned scoped enumerations.

Template Parameters
EEnumeration type (Type::UnsignedEnum).
Parameters
aLeft operand.
bRight operand.
Returns
E with bits of a or b.

◆ operator~()

template<Type::UnsignedEnum E>
constexpr E operator~ ( E  a)
constexprnoexcept

Bitwise NOT for unsigned scoped enumerations.

Template Parameters
EEnumeration type (Type::UnsignedEnum).
Parameters
aOperand.
Returns
E with bits of a inverted.