A reference wrapper.
More...
#include <gf/Ref.h>
|
| Ref (T &ref) noexcept |
| Constructor with a lvalue reference. More...
|
|
| Ref (T &&)=delete |
| Deleted constructor with rvalue reference. More...
|
|
| Ref (const Ref &other) noexcept=default |
| Copy constructor. More...
|
|
template<typename U , typename = std::enable_if_t<std::is_base_of<T, U>::value>> |
| Ref (const Ref< U > &other) noexcept |
| Copy constructor. More...
|
|
Ref & | operator= (const Ref &other) noexcept=default |
| Copy assignment. More...
|
|
template<typename U , typename = std::enable_if_t<std::is_base_of<T, U>::value>> |
Ref & | operator= (const Ref< U > &other) noexcept |
| Copy assignment. More...
|
|
T & | get () const noexcept |
| Get the reference. More...
|
|
| operator T& () const noexcept |
| Conversion to a reference. More...
|
|
|
(Note that these are not member functions.)
|
template<typename T > |
constexpr bool | operator== (Ref< T > lhs, Ref< T > rhs) noexcept |
| Referece comparison. More...
|
|
template<typename T > |
constexpr bool | operator== (Ref< T > lhs, const T &rhs) noexcept |
| Referece comparison. More...
|
|
template<typename T > |
constexpr bool | operator== (const T &lhs, Ref< T > rhs) noexcept |
| Referece comparison. More...
|
|
template<typename T > |
Ref< T > | ref (T &object) |
| Reference creation. More...
|
|
template<typename T>
class gf::Ref< T >
A reference wrapper.
This class is similar to std::reference_wrapper.
◆ Ref() [1/4]
Constructor with a lvalue reference.
- Parameters
-
◆ Ref() [2/4]
Deleted constructor with rvalue reference.
◆ Ref() [3/4]
◆ Ref() [4/4]
template<typename T >
template<typename U , typename = std::enable_if_t<std::is_base_of<T, U>::value>>
◆ get()
Get the reference.
- Returns
- A reference to the object
◆ operator T&()
template<typename T >
gf::Ref< T >::operator T& |
( |
| ) |
const |
|
inlinenoexcept |
Conversion to a reference.
- Returns
- A reference to the object
◆ operator=() [1/2]
◆ operator=() [2/2]
template<typename T >
template<typename U , typename = std::enable_if_t<std::is_base_of<T, U>::value>>
◆ operator==() [1/3]
template<typename T >
constexpr bool operator== |
( |
const T & |
lhs, |
|
|
Ref< T > |
rhs |
|
) |
| |
|
related |
Referece comparison.
The reference are compared by address, not by value.
◆ operator==() [2/3]
template<typename T >
constexpr bool operator== |
( |
Ref< T > |
lhs, |
|
|
const T & |
rhs |
|
) |
| |
|
related |
Referece comparison.
The reference are compared by address, not by value.
◆ operator==() [3/3]
template<typename T >
constexpr bool operator== |
( |
Ref< T > |
lhs, |
|
|
Ref< T > |
rhs |
|
) |
| |
|
related |
Referece comparison.
The reference are compared by address, not by value.
◆ ref()
template<typename T >
Ref< T > ref |
( |
T & |
object | ) |
|
|
related |