lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
|
Stores and calls a callable object on destruction, if not disarmed. More...
#include <scope_guard.h>
Public Member Functions | |
LEAN_INLINE | scope_guard_impl (const Callable &callable, bool arm=true) |
Stores the given callable, to be called on destruction, if not disarmed. | |
LEAN_INLINE | ~scope_guard_impl () |
Calls the callable stored by this guard, if not disarmed. | |
LEAN_INLINE void | armed (bool arm) const |
Sets whether the scope guard is currently armed. | |
LEAN_INLINE bool | armed () const |
Gets whether the scope guard is currently armed. | |
LEAN_INLINE void | disarm () const |
Disarms this scope guard. | |
LEAN_INLINE void | arm () const |
Re-arms this scope guard. |
Stores and calls a callable object on destruction, if not disarmed.