Operators available to elements of enumerations if BitwiseTraits is specialized.
As required, when parsed by a C++ compiler, the operators reside in the global namespace.
Function Index: | |
| template<typename TEnum> | |
| constexpr int | CountElements (TEnum value) |
| template<typename TEnum> | |
| constexpr bool | HasBits (TEnum element, TEnum selection) noexcept |
| template<typename TEnum> | |
| constexpr bool | HasOneOf (TEnum element, TEnum selection) noexcept |
| template<typename TEnum> | |
| ALIB_EXPORT constexpr TEnum | operator& (TEnum lhs, TEnum rhs) noexcept |
| template<typename TEnum> | |
| ALIB_EXPORT constexpr TEnum | operator&= (TEnum &lhs, TEnum rhs) noexcept |
| template<typename TEnum> | |
| ALIB_EXPORT constexpr TEnum | operator+ (TEnum lhs, TEnum rhs) noexcept |
| template<typename TEnum> | |
| ALIB_EXPORT constexpr TEnum | operator+= (TEnum &lhs, TEnum rhs) noexcept |
| template<typename TEnum> | |
| ALIB_EXPORT constexpr TEnum | operator- (TEnum lhs, TEnum rhs) noexcept |
| template<typename TEnum> | |
| ALIB_EXPORT constexpr TEnum | operator-= (TEnum &lhs, TEnum rhs) noexcept |
| template<typename TEnum> | |
| ALIB_EXPORT constexpr TEnum | operator^ (TEnum lhs, TEnum rhs) noexcept |
| template<typename TEnum> | |
| ALIB_EXPORT constexpr TEnum | operator^= (TEnum &lhs, TEnum rhs) noexcept |
| template<typename TEnum> | |
| ALIB_EXPORT constexpr TEnum | operator| (TEnum lhs, TEnum rhs) noexcept |
| template<typename TEnum> | |
| ALIB_EXPORT constexpr TEnum | operator|= (TEnum &lhs, TEnum rhs) noexcept |
| template<typename TEnum> | |
| ALIB_EXPORT constexpr TEnum | operator~ (TEnum op) noexcept |
| template<typename TEnum> | |
| constexpr TEnum | ToBitwiseEnumeration (typename std::underlying_type< TEnum >::type number) |
| template<typename TEnum> | |
| constexpr std::underlying_type< TEnum >::type | ToSequentialEnumeration (TEnum element) |
|
constexpr |
Returns the number of bitwise enumeration elements set in the given value. In other words, the bits given in value are counted and the number is returned.
Selected by the compiler only if BitwiseTraits is specialized for template enum type TEnum to inherit std::true_type.
| value | A single or composite selection of bits. |
Definition at line 359 of file bitwise.inl.
|
constexprnoexcept |
Tests if the integral value of the given enum element contains all bits set in selection. In other words, returns result of:
( element & selection ) == selection
Selected by the compiler only if BitwiseTraits is specialized for template enum type TEnum to inherit std::true_type.
| TEnum | Enumeration type. Deduced by the compiler. |
| element | Bitset to be tested. |
| selection | Second operand. |
true if all bits of selection are set in element. Definition at line 324 of file bitwise.inl.
|
constexprnoexcept |
Tests if the integral value of the given enum element contains at least one of the bits set in selection. In other words, returns result of:
( element & selection ) != 0
Selected by the compiler only if BitwiseTraits is specialized for template enum type TEnum to inherit std::true_type.
| TEnum | Enumeration type. Deduced by the compiler. |
| element | Bitset to be tested. |
| selection | Second operand. |
true if one of the bits of selection are set in element. Definition at line 344 of file bitwise.inl.
|
constexprnoexcept |
Bitwise and operator usable with scoped enum types.
Selected by the compiler only if BitwiseTraits is specialized for template enum type TEnum to inherit std::true_type.
| TEnum | Enumeration type. |
| lhs | First operand. |
| rhs | Second operand. |
Definition at line 118 of file bitwise.inl.
|
constexprnoexcept |
Bitwise assignment operator usable with scoped enum types.
Selected by the compiler only if BitwiseTraits is specialized for template enum type TEnum to inherit std::true_type.
| TEnum | Enumeration type. |
| [in,out] | lhs | Reference to the first operand. Receives the result. |
| rhs | Second operand. |
lhs & rhs. Definition at line 134 of file bitwise.inl.
|
constexprnoexcept |
Alias to bitwise or operator usable with scoped enum types.
Selected by the compiler only if BitwiseTraits is specialized for template enum type TEnum to inherit std::true_type and if ArithmeticalTraits is not specialized to inherit std::true_type. The latter is to avoid ambiguities in situations where an enum is both, arithmetical and bitwise.
| TEnum | Enumeration type. |
| lhs | First operand. |
| rhs | Second operand. |
Definition at line 237 of file bitwise.inl.
|
constexprnoexcept |
Alias for bitwise or assignment operator usable with scoped enum types.
Selected by the compiler only if BitwiseTraits is specialized for template enum type TEnum to inherit std::true_type and if ArithmeticalTraits is not specialized to inherit std::true_type. The latter is to avoid ambiguities in situations where an enum is both, arithmetical and bitwise.
| TEnum | Enumeration type. |
| [in,out] | lhs | Reference to the first operand. Receives the result. |
| rhs | Second operand. |
lhs | rhs. Definition at line 256 of file bitwise.inl.
|
constexprnoexcept |
Removes bit(s) found in rhs from lhs an returns result. This is a shortcut to:
lhs & !rhs
Selected by the compiler only if BitwiseTraits is specialized for template enum type TEnum to inherit std::true_type and if ArithmeticalTraits is not specialized to inherit std::true_type. The latter is to avoid ambiguities in situations where an enum is both, arithmetical and bitwise.
| TEnum | Enumeration type. |
| lhs | First operand. |
| rhs | Second operand. |
lhs & !rhs. Definition at line 278 of file bitwise.inl.
|
constexprnoexcept |
Removes bit(s) found in rhs from lhs. This is a shortcut to:
lhs &= !rhs
Selected by the compiler only if BitwiseTraits is specialized for template enum type TEnum to inherit std::true_type and if ArithmeticalTraits is not specialized to inherit std::true_type. The latter is to avoid ambiguities in situations where an enum is both, arithmetical and bitwise.
| TEnum | Enumeration type. |
| [in,out] | lhs | Reference to the first operand. Receives the result. |
| rhs | Second operand. |
lhs & ( ~rhs ). Definition at line 300 of file bitwise.inl.
|
constexprnoexcept |
Bitwise xor operator usable with scoped enum types.
Selected by the compiler only if BitwiseTraits is specialized for template enum type TEnum to inherit std::true_type.
| TEnum | Enumeration type. |
| lhs | First operand. |
| rhs | Second operand. |
Definition at line 182 of file bitwise.inl.
|
constexprnoexcept |
Bitwise xor assignment operator usable with scoped enum types.
Selected by the compiler only if BitwiseTraits is specialized for template enum type TEnum to inherit std::true_type.
| TEnum | Enumeration type. |
| [in,out] | lhs | Reference to the first operand. Receives the result. |
| rhs | Second operand. |
lhs ^ rhs. Definition at line 198 of file bitwise.inl.
|
constexprnoexcept |
Bitwise or operator usable with scoped enum types.
Selected by the compiler only if BitwiseTraits is specialized for template enum type TEnum to inherit std::true_type.
| TEnum | Enumeration type. |
| lhs | First operand. |
| rhs | Second operand. |
Definition at line 150 of file bitwise.inl.
|
constexprnoexcept |
Bitwise or assignment operator usable with scoped enum types.
Selected by the compiler only if BitwiseTraits is specialized for template enum type TEnum to inherit std::true_type.
| TEnum | Enumeration type. |
| [in,out] | lhs | Reference to the first operand. Receives the result. |
| rhs | Second operand. |
lhs | rhs. Definition at line 166 of file bitwise.inl.
|
constexprnoexcept |
Bitwise not operator usable with scoped enum types.
Selected by the compiler only if BitwiseTraits is specialized for template enum type TEnum to inherit std::true_type.
| TEnum | Enumeration type. |
| op | The operand to be negated. |
Definition at line 217 of file bitwise.inl.
|
constexpr |
Returns the bitwise enumeration element of TEnum from a given sequential enumeration.
Selected by the compiler only if BitwiseTraits is specialized for template enum type TEnum to inherit std::true_type.
| TEnum | An enumeration type which is defined to be "bitwise". |
| number | A sequentially enumerated number, for which the corresponding bitwise enumeration element is requested. bitwise enumeration. |
1 << number. Definition at line 30 of file bitwise_iterable_conversion.inl.
|
constexpr |
Returns the sequentially enumerated number derived from the given bitwise enumeration value. In other words, the positon of the most significant bit set in the underlying integral of the given enum element is returned.
In debug-compilations an ALib Assertion is raised in case that the given value is not a single enum element but a combination of bits.
Selected by the compiler only if BitwiseTraits is specialized for template enum type TEnum to inherit std::true_type.
| TEnum | A bitwise defined enumeration type. Deduced by the compiler. |
| element | An enumeration value. |
Definition at line 55 of file bitwise_iterable_conversion.inl.