20
General utilities library
[utilities]
20.15
Metaprogramming and type traits
[meta]
20.15.8
Transformations between types
[meta.trans]
20.15.8.3
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
1
:
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
2
:
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
]