![]() |
cppassist
1.0.0.f4fab4f962ff
C++ sanctuary for small but powerful and frequently required, stand alone features.
|
#include <cppassist/include/cppassist/flags/Flags.h>
Public Types | |
using | type = EnumType |
enum type More... | |
using | underlying_type = typename std::underlying_type< EnumType >::type |
Underlying enum type. More... | |
Public Member Functions | |
Flags () | |
Constructor. More... | |
Flags (EnumType value) | |
Constructor. More... | |
Flags (std::initializer_list< EnumType > values) | |
Constructor. More... | |
operator bool () const | |
Conversion to bool for explicit contexts. More... | |
operator underlying_type () const | |
Conversion to underlying type. More... | |
Protected Member Functions | |
Flags (underlying_type value) | |
Constructor. More... | |
Protected Attributes | |
underlying_type | m_value |
The current value (a bit combination) More... | |
using cppassist::Flags< EnumType >::type = EnumType |
enum type
using cppassist::Flags< EnumType >::underlying_type = typename std::underlying_type<EnumType>::type |
Underlying enum type.
cppassist::Flags< EnumType >::Flags | ( | ) |
Constructor.
Creates an empty flag object
cppassist::Flags< EnumType >::Flags | ( | EnumType | value | ) |
Constructor.
[in] | value | The initial value of the flags object |
cppassist::Flags< EnumType >::Flags | ( | std::initializer_list< EnumType > | values | ) |
Constructor.
[in] | values | The initial values of the flags object |
All values are 'or'-ed for the resulting value of the flags object
|
protected |
Constructor.
[in] | value | The value of the flags object |
|
explicit |
Conversion to bool for explicit contexts.
true
if at least one bit is set, else false
References cppassist::Flags< EnumType >::m_value.
cppassist::Flags< EnumType >::operator underlying_type | ( | ) | const |
Conversion to underlying type.
References cppassist::Flags< EnumType >::m_value.
|
protected |
The current value (a bit combination)
Referenced by cppassist::Flags< EnumType >::operator bool(), and cppassist::Flags< EnumType >::operator underlying_type().