Files
2025-10-25 03:02:53 +03:00

2.1 KiB
Raw Permalink Blame History

[meta.trans.ref]

21 Metaprogramming library [meta]

21.3 Metaprogramming and type traits [type.traits]

21.3.9 Transformations between types [meta.trans]

21.3.9.3 Reference modifications [meta.trans.ref]

1

#

The templates specified in Table 58 add or remove references.

Table 58 — Reference modifications [tab:meta.trans.ref]

🔗
Template
Comments
🔗
template struct remove_reference;
If T has type “reference to T1” then the member typedef type denotes T1; otherwise, type denotes T.
🔗
template 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 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 is not an rvalue reference. — end note]