#include <scope_guard.h>
Public Member Functions | |
constexpr | ScopeGuard (Functor &&functor) |
constexpr | ScopeGuard (ScopeGuard &&other) noexcept |
template<typename OtherFunctor > | |
constexpr | ScopeGuard (ScopeGuard< OtherFunctor > &&other) |
ScopeGuard & | operator= (ScopeGuard &&other) noexcept |
ScopeGuard (const ScopeGuard &)=delete | |
ScopeGuard & | operator= (const ScopeGuard &)=delete |
void | Dismiss () |
ScopeGuard
ensures that the specified functor is executed no matter how the current scope exits, unless it is dismissed.
Example:
|
inline |
Dismisses the ScopeGuard
, meaning it will no longer execute the Functor
when it goes out of scope.