|
854 | 854 | \end{itemdecl}
|
855 | 855 |
|
856 | 856 | \begin{itemdescr}
|
| 857 | +Let \tcode{Vi} be \tcode{unwrap_ref_decay_t<Ti>}. |
| 858 | + |
857 | 859 | \pnum
|
858 |
| -\returns \tcode{pair<V1, V2>(std::forward<T1>(x), std::forward<T2>(y))}, |
859 |
| -where \tcode{V1} and \tcode{V2} are determined as follows: Let \tcode{Ui} be |
860 |
| -\tcode{decay_t<Ti>} for each \tcode{Ti}. If \tcode{Ui} is a specialization |
861 |
| -of \tcode{reference_wrapper}, then \tcode{Vi} is \tcode{Ui::type\&}, |
862 |
| -otherwise \tcode{Vi} is \tcode{Ui}. |
| 860 | +\returns \tcode{pair<V1, V2>(std::forward<T1>(x), std::forward<T2>(y))}. |
863 | 861 | \end{itemdescr}
|
864 | 862 |
|
865 | 863 | \pnum
|
|
1601 | 1599 |
|
1602 | 1600 | \begin{itemdescr}
|
1603 | 1601 | \pnum
|
1604 |
| -The pack \tcode{VTypes} is defined as follows. Let \tcode{U}$_i$ be \tcode{decay_t<T$_i$>} for each |
1605 |
| -\tcode{T}$_i$ in \tcode{TTypes}. If \tcode{U}$_i$ is a specialization of |
1606 |
| -\tcode{reference_wrapper}, then \tcode{V}$_i$ in \tcode{VTypes} is \tcode{U$_i$::type\&}, |
1607 |
| -otherwise \tcode{V}$_i$ is \tcode{U}$_i$. |
| 1602 | +Let \tcode{VTypes...} be \tcode{unwrap_ref_decay_t<TTypes>...}. |
1608 | 1603 |
|
1609 | 1604 | \pnum
|
1610 | 1605 | \returns \tcode{tuple<VTypes...>(std::forward<TTypes>(t)...)}.
|
|
12944 | 12939 | \rSec2[functional.syn]{Header \tcode{<functional>} synopsis}
|
12945 | 12940 |
|
12946 | 12941 | \indexhdr{functional}%
|
| 12942 | +\indexlibrary{unwrap_ref_decay}% |
| 12943 | +\indexlibrary{unwrap_ref_decay_t}% |
12947 | 12944 | \begin{codeblock}
|
12948 | 12945 | namespace std {
|
12949 | 12946 | // \ref{func.invoke}, invoke
|
|
12962 | 12959 | template<class T> reference_wrapper<T> ref(reference_wrapper<T>) noexcept;
|
12963 | 12960 | template<class T> reference_wrapper<const T> cref(reference_wrapper<T>) noexcept;
|
12964 | 12961 |
|
| 12962 | + template<class T> struct unwrap_reference; |
| 12963 | + template<class T> struct unwrap_ref_decay : unwrap_reference<decay_t<T>> {}; |
| 12964 | + template<class T> using unwrap_ref_decay_t = typename unwrap_ref_decay<T>::type; |
| 12965 | + |
12965 | 12966 | // \ref{arithmetic.operations}, arithmetic operations
|
12966 | 12967 | template<class T = void> struct plus;
|
12967 | 12968 | template<class T = void> struct minus;
|
|
13318 | 13319 | \pnum\returns The stored reference.
|
13319 | 13320 | \end{itemdescr}
|
13320 | 13321 |
|
13321 |
| - |
13322 | 13322 | \rSec3[refwrap.invoke]{Invocation}
|
13323 | 13323 |
|
13324 | 13324 | \indexlibrarymember{operator()}{reference_wrapper}%
|
|
13371 | 13371 | \pnum\returns \tcode{cref(t.get())}.
|
13372 | 13372 | \end{itemdescr}
|
13373 | 13373 |
|
| 13374 | +\rSec3[refwrap.unwrapref]{Transformation type trait \tcode{unwrap_reference}} |
| 13375 | + |
| 13376 | +\indexlibrary{unwrap_reference}% |
| 13377 | +\begin{itemdecl} |
| 13378 | +template<class T> |
| 13379 | + struct unwrap_reference; |
| 13380 | +\end{itemdecl} |
| 13381 | + |
| 13382 | +\pnum |
| 13383 | +If \tcode{T} is |
| 13384 | +a specialization \tcode{reference_wrapper<X>} for some type \tcode{X}, |
| 13385 | +the member typedef \tcode{type} of \tcode{unwrap_reference<T>} is \tcode{X\&}, |
| 13386 | +otherwise it is \tcode{T}. |
| 13387 | + |
13374 | 13388 | \rSec2[arithmetic.operations]{Arithmetic operations}
|
13375 | 13389 |
|
13376 | 13390 | \pnum
|
|
0 commit comments