Namespaces
Variants
Views
Actions

std::add_lvalue_reference, std::add_rvalue_reference

From cppreference.com
< cpp‎ | types
Revision as of 17:30, 2 November 2012 by P12bot (Talk | contribs)

 
 
 
Type support
Basic types
Fundamental types
Fixed width integer types (C++11)
Numeric limits
C numeric limits interface
Runtime type information
Type traits
Primary type categories
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
Type properties
(C++11)
(C++11)
(C++11)
(C++14)
Supported operations
Relationships and property queries
(C++11)
(C++11)
(C++11)
(C++11)
Type modifications
(C++11)(C++11)(C++11)
add_lvalue_referenceadd_rvalue_reference
(C++11)(C++11)
Type transformations
(C++11)
(C++11)
(C++11)
Type trait constants
 

Template:ddcl list begin <tr class="t-dsc-header">

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

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

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

<td > (1) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

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

<td > (2) </td> <td > (since C++11) </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

Name Definition
type reference to T, or T if not allowed

Notes

These type transformations honor reference collapse rules:

std::add_lvalue_reference<T&>::type is T&
std::add_lvalue_reference<T&&>::type is T&
std::add_rvalue_reference<T&>::type is T&
std::add_rvalue_reference<T&&>::type is T&&

Example

See also

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