Namespaces
Variants
Views
Actions

std::add_lvalue_reference, std::add_rvalue_reference

From cppreference.com
< cpp‎ | types
Revision as of 13:30, 27 October 2011 by Cubbi (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:cpp/types/sidebar Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <type_traits>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td >
template< class T >
struct add_lvalue_reference;
</td>

<td > (1) </td> <td > Template:mark c++11 feature </td> </tr> <tr class="t-dcl ">

<td >
template< class T >
struct add_rvalue_reference;
</td>

<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:

Template:cpp

Example

Template:example cpp

See also

checks if a type is either an lvalue reference or rvalue reference
(class template) [edit]
removes a reference from the given type
(class template) [edit]