nngn
|
Wrapper for a small unsigned integral representing flags. More...
#include <flags.h>
Public Types | |
using | UT = std::underlying_type_t<T> |
Value type stored in the object. | |
using | AT = std::conditional_t<scoped_enum<T>, T, UT> |
Accepted type for integral arguments. | |
using | PT = std::common_type_t<UT, int> |
Promoted type after an operation involving T s. | |
Public Member Functions | |
constexpr | Flags (void)=default |
constexpr | Flags (UT u) |
constexpr | Flags (AT a) |
constexpr | operator T (void) const |
constexpr T | operator* (void) const |
constexpr Flags | operator~ (void) const |
constexpr Flags | operator- (void) const |
constexpr Flags | operator& (AT rhs) |
constexpr Flags | operator| (AT rhs) |
constexpr Flags | operator^ (AT rhs) |
constexpr Flags & | operator&= (Flags rhs) |
constexpr Flags & | operator|= (Flags rhs) |
constexpr Flags & | operator^= (Flags rhs) |
constexpr bool | is_set (AT a) const |
constexpr Flags & | comp (void) |
constexpr Flags & | set (AT a) |
constexpr Flags & | set (AT a, bool b) |
constexpr Flags & | clear (AT a) |
constexpr Flags | check_and_clear (AT a) |
Static Public Member Functions | |
static constexpr Flags | cast (PT x) |
Creates an object from the result of an expression. | |
Public Attributes | |
UT | v = {} |
Wrapper for a small unsigned integral representing flags.
Operations cast the result back to the underlying type to remove the need for explicit casts when it is converted to int
.
Accepted type for integral arguments.
using nngn::Flags< T >::PT = std::common_type_t<UT, int> |
Promoted type after an operation involving T
s.
using nngn::Flags< T >::UT = std::underlying_type_t<T> |
Value type stored in the object.
|
constexprdefault |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlinestaticconstexpr |
Creates an object from the result of an expression.
|
constexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
constexpr |
UT nngn::Flags< T >::v = {} |