CppCommon
1.0.4.1
C++ Common Library
|
Enum-based flags. More...
#include <flags.h>
Public Member Functions | |
Flags () noexcept | |
Flags (type value) noexcept | |
Flags (TEnum value) noexcept | |
Flags (const Flags &) noexcept=default | |
Flags (Flags &&) noexcept=default | |
~Flags () noexcept=default | |
Flags & | operator= (type value) noexcept |
Flags & | operator= (TEnum value) noexcept |
Flags & | operator= (const Flags &) noexcept=default |
Flags & | operator= (Flags &&) noexcept=default |
operator bool () const noexcept | |
Is any flag set? More... | |
bool | operator! () const noexcept |
Is no flag set? More... | |
Flags | operator~ () const noexcept |
Reverse all flags. More... | |
Flags & | operator&= (const Flags &flags) noexcept |
Flags logical assign operators. More... | |
Flags & | operator|= (const Flags &flags) noexcept |
Flags & | operator^= (const Flags &flags) noexcept |
operator TEnum () const noexcept | |
Convert to the enum value. More... | |
bool | isset () const noexcept |
Is any flag set? More... | |
bool | isset (type value) const noexcept |
Is the given flag set? More... | |
bool | isset (TEnum value) const noexcept |
Is the given flag set? More... | |
TEnum | value () const noexcept |
Get the enum value. More... | |
type | underlying () const noexcept |
Get the underlying enum value. More... | |
std::bitset< sizeof(type) *8 > | bitset () const noexcept |
Get the bitset value. More... | |
void | swap (Flags &flags) noexcept |
Swap two instances. More... | |
Friends | |
Flags | operator& (const Flags &flags1, const Flags &flags2) noexcept |
Flags logical friend operators. More... | |
Flags | operator| (const Flags &flags1, const Flags &flags2) noexcept |
Flags | operator^ (const Flags &flags1, const Flags &flags2) noexcept |
bool | operator== (const Flags &flags1, const Flags &flags2) noexcept |
bool | operator!= (const Flags &flags1, const Flags &flags2) noexcept |
template<typename UEnum > | |
void | swap (Flags< UEnum > &flags1, Flags< UEnum > &flags2) noexcept |
Enum-based flags.
Helper class for enum based flags which wraps particular enum as a template parameter and provides flags manipulation operators and methods.
Not thread-safe.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
defaultnoexcept |
|
defaultnoexcept |
|
defaultnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineexplicitnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
defaultnoexcept |
|
defaultnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
friend |