Flag guard type. More...
#include <playrho/FlagGuard.hpp>
Public Member Functions | |
FlagGuard (const FlagGuard< T > &value)=delete | |
Copy constructor is deleted. | |
FlagGuard (FlagGuard< T > &&value) noexcept=default | |
Move constructor. | |
FlagGuard (T &flag, T value) | |
Initializing constructor. More... | |
~FlagGuard () noexcept | |
Destructor. More... | |
FlagGuard< T > & | operator= (const FlagGuard< T > &value)=delete |
Copy assignment operator is deleted. | |
FlagGuard< T > & | operator= (FlagGuard< T > &&value) noexcept=default |
Move assignment operator. | |
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.