Regina Calculation Engine
|
A wrapper allowing references to be passed through generic functions. More...
#include <utilities/boostutils.h>
Public Types | |
typedef T | type |
The data type being referenced by this wrapper. More... | |
Public Member Functions | |
reference_wrapper (type &t) | |
Creates a new wrapper to reference the given object. More... | |
operator type & () const | |
Returns a reference to the object being referenced. More... | |
type & | get () const |
Returns a reference to the object being referenced. More... | |
type * | get_pointer () const |
Returns a pointer to the object being referenced. More... | |
A wrapper allowing references to be passed through generic functions.
This class is for use with the Standard Template Library.
The primary advantage of this class is its implicit conversion to type T&
. Thus it can be passed to routines expecting references to T
but can also be passed by reference itself.
See global routines regina::boost::ref() and regina::boost::cref() for simple creation of these wrappers.
typedef T regina::boost::reference_wrapper< T >::type |
The data type being referenced by this wrapper.
|
inlineexplicit |
Creates a new wrapper to reference the given object.
t | the object to be referenced. |
|
inline |
Returns a reference to the object being referenced.
|
inline |
Returns a pointer to the object being referenced.
|
inline |
Returns a reference to the object being referenced.
This routine provides an implicit conversion to type T&
.