stlab-enum-ops 1.1.0
Type-safe operators for enums
|
Operations available for both bitmask and arithmetic-enabled enums. More...
Functions | |
template<class T> | |
constexpr auto | operator- (T a) -> std::enable_if_t< stlab::has_enabled_arithmetic< T >||stlab::has_enabled_bitmask< T >, T > |
Unary minus enums. For bitmask-enabled enums, this allows expressions like e & -e to return the least set bit. | |
template<class T> | |
constexpr auto | operator== (T lhs, std::nullptr_t) -> std::enable_if_t<(stlab::has_enabled_bitmask< T >||stlab::has_enabled_arithmetic< T >) &&!stlab::is_compatible_scalar< T, T >, bool > |
Equality with nullptr for bitmask or arithmetic scoped enums; true when the value is zero. | |
template<class T> | |
constexpr auto | operator== (std::nullptr_t, T rhs) -> std::enable_if_t<(stlab::has_enabled_bitmask< T >||stlab::has_enabled_arithmetic< T >) &&!stlab::is_compatible_scalar< T, T >, bool > |
Equality with nullptr for bitmask or arithmetic scoped enums; true when the value is zero. | |
template<class T> | |
constexpr auto | operator!= (T lhs, std::nullptr_t rhs) -> std::enable_if_t<(stlab::has_enabled_bitmask< T >||stlab::has_enabled_arithmetic< T >) &&!stlab::is_compatible_scalar< T, T >, bool > |
Inequality with nullptr for bitmask or arithmetic scoped enums. | |
template<class T> | |
constexpr auto | operator!= (std::nullptr_t lhs, T rhs) -> std::enable_if_t<(stlab::has_enabled_bitmask< T >||stlab::has_enabled_arithmetic< T >) &&!stlab::is_compatible_scalar< T, T >, bool > |
Inequality with nullptr for bitmask or arithmetic scoped enums. | |
template<class T> | |
constexpr auto | operator! (T lhs) -> std::enable_if_t< stlab::has_enabled_bitmask< T >||stlab::has_enabled_arithmetic< T >, bool > |
Logical NOT for bitmask or arithmetic enums; true when the value converts to false. |
Operations available for both bitmask and arithmetic-enabled enums.
These operations are available for enums that have either bitmask or arithmetic operations enabled.