21
Metaprogramming library
[meta]
21.3
Metaprogramming and type traits
[type.traits]
21.3.8
Transformations between types
[meta.trans]
21.3.8.3
Reference modifications
[meta.trans.ref]
1
#
The templates specified in Table
55
add or remove references
.
Table
55
: 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
denotes
T1
; otherwise,
type
denotes
T
.
π
template
<
class
T
>
struct
add_
lvalue_
reference;
If
T
is a referenceable type (
[defns.
referenceable]
) then the member typedef
type
denotes
T
&
; otherwise,
type
denotes
T
.
[
Note
1
:
This rule reflects the semantics of reference collapsing (
[dcl.
ref]
)
.
β
end note
]
π
template
<
class
T
>
struct
add_
rvalue_
reference;
If
T
is a referenceable type then the member typedef
type
denotes
T
&
&
; otherwise,
type
denotes
T
.
[
Note
2
:
This rule reflects the semantics of reference collapsing (
[dcl.
ref]
)
.
For example, when a type
T
is a reference type
T1
&
, the type
add_
rvalue_
reference_
t
<
T
>
is not an rvalue reference
.
β
end note
]