|
Dev Essential
|
#include <scopeguard.h>
Public Member Functions | |
| ScopeGuard (const ScopeGuard &)=delete | |
| ScopeGuard & | operator= (const ScopeGuard &)=delete |
| ScopeGuard & | operator= (ScopeGuard &&other)=delete |
| ScopeGuard (ScopeGuard &&other) | |
| ScopeGuard (F &&f) | |
| ~ScopeGuard () | |
| void | dismiss () noexcept |
| void | rehire () noexcept |
Scope guard executing a callable object of type F on scope exit.
The callable execution can be disabled/re-enabled by using dismiss() or rehire() respectively (default: enabled).
To actually create scope guards objects, the following convenience functions are provided:
| F | Type of the callable object (pointer to function, lambda, etc.) |
|
inlineexplicit |
Ctor
| [in] | f | The callable object to execute on scope exit |
|
inline |
Destroy the scope guard object and execute the callable if execution is enabled
|
inlinenoexcept |
Dismiss the execution of the callable on scope exit
|
inlinenoexcept |
Rehire the execution of the callable on scope exit