20 General utilities library [utilities]

20.15 Metaprogramming and type traits [meta]

20.15.7 Transformations between types [meta.trans]

20.15.7.2 Reference modifications [meta.trans.ref]

Table 53: Reference modifications   [tab:meta.trans.ref]
Template
Comments
template<class T>
struct remove_­reference;
If T has type “reference to T1” then the member typedef type names T1; otherwise, type names T.
template<class T>
struct add_­lvalue_­reference;
If T names a referenceable type then the member typedef type names T&; otherwise, type names T.
[Note
:
This rule reflects the semantics of reference collapsing ([dcl.ref]).
— end note
]
template<class T>
struct add_­rvalue_­reference;
If T names a referenceable type then the member typedef type names T&&; otherwise, type names T.
[Note
:
This rule reflects the semantics of reference collapsing ([dcl.ref]).
For example, when a type T names a type T1&, the type add_­rvalue_­reference_­t<T> is not an rvalue reference.
— end note
]