0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Hypertable::RefHolder< T > Class Template Reference

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

RefHolderoperator= (const RefHolder &)
 

Private Attributes

T & m_ref
 

Detailed Description

template<class T>
class Hypertable::RefHolder< T >

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.

Constructor & Destructor Documentation

template<class T >
Hypertable::RefHolder< T >::RefHolder ( T &  ref)
inline

Definition at line 277 of file ScopeGuard.h.

Member Function Documentation

template<class T >
Hypertable::RefHolder< T >::operator T & ( ) const
inline

Definition at line 278 of file ScopeGuard.h.

template<class T >
RefHolder& Hypertable::RefHolder< T >::operator= ( const RefHolder< T > &  )
private

Member Data Documentation

template<class T >
T& Hypertable::RefHolder< T >::m_ref
private

Definition at line 282 of file ScopeGuard.h.


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