cesium-native
0.41.0
|
A utility that will automatically call the lambda function when exiting a scope. More...
#include <CesiumUtility/ScopeGuard.h>
Public Member Functions | |
template<typename ExitFunctionArg , typename std::enable_if_t< !std::is_same_v< std::remove_reference_t< std::remove_const_t< ExitFunctionArg >>, ScopeGuard< ExitFunction >>, int > = 0> | |
ScopeGuard (ExitFunctionArg &&_exitFunc) | |
Constructor. More... | |
ScopeGuard (const ScopeGuard &rhs)=delete | |
ScopeGuard (ScopeGuard &&rhs) noexcept | |
Move constructor. The rhs will move its lambda to the lhs, and the rhs will not call its lambda upon exiting a scope. | |
ScopeGuard & | operator= (const ScopeGuard &rhs)=delete |
ScopeGuard & | operator= (ScopeGuard &&rhs) noexcept |
Move assignment operator. The rhs will move its lambda to the lhs, and the rhs will not call its lambda upon exiting a scope. | |
~ScopeGuard () noexcept | |
Destructor. The guard will execute the lambda function when exiting a scope if it's not released. | |
void | release () noexcept |
Upon calling ScopeGuard::release(), the guard will not execute the lambda function when exiting a scope. | |
A utility that will automatically call the lambda function when exiting a scope.
ExitFunction | The function type to be called when the guard is out of scope. |
Definition at line 14 of file ScopeGuard.h.
|
inlineexplicit |
Constructor.
ExitFunctionArg | The function type to be called when the guard is out of scope |
Definition at line 29 of file ScopeGuard.h.