|
13520 | 13520 | template<class T> constexpr reference_wrapper<T> ref(reference_wrapper<T>) noexcept;
|
13521 | 13521 | template<class T> constexpr reference_wrapper<const T> cref(reference_wrapper<T>) noexcept;
|
13522 | 13522 |
|
13523 |
| - template<class T> struct unwrap_reference; |
13524 |
| - template<class T> using @\libglobal{unwrap_reference_t}@ = typename unwrap_reference<T>::type; |
13525 |
| - template<class T> struct unwrap_ref_decay; |
13526 |
| - template<class T> using @\libglobal{unwrap_ref_decay_t}@ = typename unwrap_ref_decay<T>::type; |
13527 |
| - |
13528 | 13523 | // \ref{arithmetic.operations}, arithmetic operations
|
13529 | 13524 | template<class T = void> struct plus;
|
13530 | 13525 | template<class T = void> struct minus;
|
|
14023 | 14018 | \tcode{cref(t.get())}.
|
14024 | 14019 | \end{itemdescr}
|
14025 | 14020 |
|
14026 |
| -\rSec3[refwrap.unwrapref]{Transformation type trait \tcode{unwrap_reference}} |
14027 |
| - |
14028 |
| -\indexlibraryglobal{unwrap_reference}% |
14029 |
| -\begin{itemdecl} |
14030 |
| -template<class T> |
14031 |
| - struct unwrap_reference; |
14032 |
| -\end{itemdecl} |
14033 |
| - |
14034 |
| -\begin{itemdescr} |
14035 |
| -\pnum |
14036 |
| -If \tcode{T} is |
14037 |
| -a specialization \tcode{reference_wrapper<X>} for some type \tcode{X}, |
14038 |
| -the member typedef \tcode{type} of \tcode{unwrap_reference<T>} is \tcode{X\&}, |
14039 |
| -otherwise it is \tcode{T}. |
14040 |
| -\end{itemdescr} |
14041 |
| - |
14042 |
| -\indexlibraryglobal{unwrap_ref_decay}% |
14043 |
| -\begin{itemdecl} |
14044 |
| -template<class T> |
14045 |
| - struct unwrap_ref_decay; |
14046 |
| -\end{itemdecl} |
14047 |
| - |
14048 |
| -\begin{itemdescr} |
14049 |
| -\pnum |
14050 |
| -The member typedef \tcode{type} of \tcode{unwrap_ref_decay<T>} |
14051 |
| -denotes the type \tcode{unwrap_reference_t<decay_t<T>>}. |
14052 |
| -\end{itemdescr} |
14053 |
| - |
14054 | 14021 | \rSec2[arithmetic.operations]{Arithmetic operations}
|
14055 | 14022 |
|
14056 | 14023 | \pnum
|
|
16540 | 16507 | template<class... T> struct common_reference;
|
16541 | 16508 | template<class T> struct underlying_type;
|
16542 | 16509 | template<class Fn, class... ArgTypes> struct invoke_result;
|
| 16510 | + template<class T> struct unwrap_reference; |
| 16511 | + template<class T> struct unwrap_ref_decay; |
16543 | 16512 |
|
16544 | 16513 | template<class T>
|
16545 | 16514 | using @\libglobal{type_identity_t}@ = typename type_identity<T>::type;
|
|
16563 | 16532 | using @\libglobal{underlying_type_t}@ = typename underlying_type<T>::type;
|
16564 | 16533 | template<class Fn, class... ArgTypes>
|
16565 | 16534 | using @\libglobal{invoke_result_t}@ = typename invoke_result<Fn, ArgTypes...>::type;
|
| 16535 | + template<class T> |
| 16536 | + using unwrap_reference_t = typename unwrap_reference<T>::type; |
| 16537 | + template<class T> |
| 16538 | + using unwrap_ref_decay_t = typename unwrap_ref_decay<T>::type; |
16566 | 16539 | template<class...>
|
16567 | 16540 | using @\libglobal{void_t}@ = void;
|
16568 | 16541 |
|
|
18104 | 18077 | \br
|
18105 | 18078 | \requires{} \tcode{Fn} and all types in the template parameter pack \tcode{ArgTypes} shall
|
18106 | 18079 | be complete types, \cv{}~\tcode{void}, or arrays of
|
18107 |
| - unknown bound.\\ |
| 18080 | + unknown bound.\\ \rowsep |
| 18081 | + |
| 18082 | +\indexlibraryglobal{unwrap_reference}% |
| 18083 | +\tcode{template<class T>} \tcode{struct unwrap_reference;} |
| 18084 | + & |
| 18085 | + If \tcode{T} is |
| 18086 | + a specialization \tcode{reference_wrapper<X>} for some type \tcode{X}, |
| 18087 | + the member typedef \tcode{type} of \tcode{unwrap_reference<T>} is \tcode{X\&}, |
| 18088 | + otherwise it is \tcode{T}. \\ \rowsep |
| 18089 | + |
| 18090 | +\indexlibraryglobal{unwrap_ref_decay}% |
| 18091 | +\tcode{template<class T>} \tcode{unwrap_ref_decay;} |
| 18092 | + & |
| 18093 | + The member typedef \tcode{type} of \tcode{unwrap_ref_decay<T>} |
| 18094 | + denotes the type \tcode{unwrap_reference_t<decay_t<T>>}.\\ |
18108 | 18095 | \end{libreqtab2a}
|
18109 | 18096 |
|
18110 | 18097 | \indexlibraryglobal{aligned_storage}%
|
|
18122 | 18109 | \end{codeblock}
|
18123 | 18110 | \end{note}
|
18124 | 18111 |
|
| 18112 | +\pnum |
| 18113 | +In addition to being available via inclusion |
| 18114 | +of the \tcode{<type_traits>} header, the templates |
| 18115 | +\tcode{unwrap_reference}, |
| 18116 | +\tcode{unwrap_ref_decay}, |
| 18117 | +\tcode{unwrap_reference_t}, and |
| 18118 | +\tcode{unwrap_ref_decay_t} |
| 18119 | +are available |
| 18120 | +when the header \tcode{<func\-tional>}\iref{functional.syn} is included. |
| 18121 | + |
18125 | 18122 | \indexlibraryglobal{common_type}%
|
18126 | 18123 | \pnum
|
18127 | 18124 | Let:
|
|
0 commit comments