Provides a wrapper which allows the original object to be passed like a reference. More...
|operator T & () const|
|Convenience operator for converting to the underlying reference directly. |
|T *||pointer () const|
|Accessor to a pointer to the original instance. |
|T &||reference () const|
|Accessor to the reference of the original instance. |
|ReferenceWrapper (T &t)|
|Constructs the wrapper around the supplied object instance. |
Provides a wrapper which allows the original object to be passed like a reference.
This class wraps the supplied object, storing it as a pointer and allowing it to be passed like a regular object. By itself, this is not terribly useful, but in combination with the ref/cref functions and also the is_reference_wrapper trait, it allows things like functions and function objects to be easily manipulated.
Note: reference wrappers might seem a bit redundant - why do we need them? The following case illustrates a desired usage scenario.
Unfortunately, when you come to call this function, you'll get an ambiguity error.
In these situations you can use a simple function call (not ref) and pass in this reference wrapper:
|T||: the type of object this class is wrapping.|
|ecl::ReferenceWrapper< T >::operator T &||(||)|| const