Helper class used to pass a parameter to the ScopeGuard by reference. More...
#include <ScopeGuard.h>
Public Member Functions | |
RefHolder (T &ref) | |
operator T & () const | |
Private Member Functions | |
RefHolder & | operator= (const RefHolder &) |
Private Attributes | |
T & | m_ref |
Helper class used to pass a parameter to the ScopeGuard by reference.
e.g.: inline void decr(int &x) { –x; }
void example() { int i = 0; ScopedGuard guard = make_guard(decr, by_ref(i)); // ... }
Definition at line 275 of file ScopeGuard.h.
|
inline |
Definition at line 277 of file ScopeGuard.h.
|
inline |
Definition at line 278 of file ScopeGuard.h.
|
private |
|
private |
Definition at line 282 of file ScopeGuard.h.