lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
Public Member Functions
lean::smart::scope_guard_impl< Callable > Class Template Reference

Stores and calls a callable object on destruction, if not disarmed. More...

#include <scope_guard.h>

Inheritance diagram for lean::smart::scope_guard_impl< Callable >:
lean::smart::scope_guard_base

List of all members.

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.

Detailed Description

template<class Callable>
class lean::smart::scope_guard_impl< Callable >

Stores and calls a callable object on destruction, if not disarmed.


The documentation for this class was generated from the following file: