Flag guard type. More...
#include <FlagGuard.hpp>
Public Member Functions | |
FlagGuard (T &flag, T value) | |
Initializing constructor. More... | |
FlagGuard (const FlagGuard< T > &value)=delete | |
Copy constructor is deleted. | |
FlagGuard (FlagGuard< T > &&value) noexcept=default | |
Move constructor. | |
FlagGuard< T > & | operator= (const FlagGuard< T > &value)=delete |
Copy assignment operator is deleted. | |
FlagGuard< T > & | operator= (FlagGuard< T > &&value) noexcept=default |
Move assignment operator. | |
~FlagGuard () noexcept | |
Destructor. More... | |
Private Attributes | |
T & | m_flag |
Flag. | |
T | m_value |
Value. | |
Flag guard type.
|
inline |
Initializing constructor.
Sets the given flag variable to the bitwise or of it with the given value and then unsets those bits on destruction of this instance.
flag | Flag variable to set until the destruction of this instance. |
value | Bit value to or with the flag variable on construction. |
|
inlinenoexcept |
Destructor.
Unsets the bits that were set on construction.