|
LibQuicR
|
Non-copyable RAII guard that invokes a callable at scope exit. More...
#include <defer.h>
Public Member Functions | |
| ScopeGuard (F &&f) | |
| Takes ownership of a callable to run at destruction. More... | |
| ScopeGuard (const ScopeGuard &other)=delete | |
| Scope guards cannot be copied. More... | |
| ScopeGuard & | operator= (const ScopeGuard &other)=delete |
| Scope guards cannot be copy-assigned. More... | |
| ~ScopeGuard () noexcept | |
| Invokes the stored callable. More... | |
Non-copyable RAII guard that invokes a callable at scope exit.
| F | Callable type, stored by value. |
|
inlineexplicit |
Takes ownership of a callable to run at destruction.
| f | Callable moved into the guard. |
| Any | exception thrown while moving f. |
|
delete |
Scope guards cannot be copied.
| other | Guard that cannot be copied. |
|
inlinenoexcept |
Invokes the stored callable.
std::terminate is called.
|
delete |
Scope guards cannot be copy-assigned.
| other | Guard that cannot be copied. |
*this.