std::add_lvalue_reference, std::add_rvalue_reference
From cppreference.com
Template:cpp/types/sidebar Template:ddcl list begin <tr class="t-dsc-header">
<td>Defined in header
</td>
<type_traits>
<td></td> <td></td> </tr> <tr class="t-dcl ">
<td >template< class T >
struct add_lvalue_reference;
</td>
struct add_lvalue_reference;
<td > (1) </td> <td > Template:mark c++11 feature </td> </tr> <tr class="t-dcl ">
<td >template< class T >
struct add_rvalue_reference;
</td>
struct add_rvalue_reference;
<td > (2) </td> <td > Template:mark c++11 feature </td> </tr> Template:ddcl list end
1) If T
is an object or function, provides a member typedef type
which is T&
. If T
is an rvalue reference to some type U
, then type
is U&
. Otherwise, type
is T
.
2) If T
is an object or function, provides a member typedef type
which is T&&
, otherwise type
is T
.
Contents |
Member types
Template:tdcl list begin Template:tdcl list hitem Template:tdcl list item Template:tdcl list end
Notes
These type transformations honor reference collapse rules:
Example
See also
(C++11) |
checks if a type is either an lvalue reference or rvalue reference (class template) |
(C++11) |
removes a reference from the given type (class template) |