Skip to content

Commit f07f4c7

Browse files
Dawn Perchikzygoloid
authored andcommitted
LWG3348 __cpp_lib_unwrap_ref in wrong header
1 parent 677ee4d commit f07f4c7

File tree

1 file changed

+31
-34
lines changed

1 file changed

+31
-34
lines changed

source/utilities.tex

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13520,11 +13520,6 @@
1352013520
template<class T> constexpr reference_wrapper<T> ref(reference_wrapper<T>) noexcept;
1352113521
template<class T> constexpr reference_wrapper<const T> cref(reference_wrapper<T>) noexcept;
1352213522

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-
1352813523
// \ref{arithmetic.operations}, arithmetic operations
1352913524
template<class T = void> struct plus;
1353013525
template<class T = void> struct minus;
@@ -14023,34 +14018,6 @@
1402314018
\tcode{cref(t.get())}.
1402414019
\end{itemdescr}
1402514020

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-
1405414021
\rSec2[arithmetic.operations]{Arithmetic operations}
1405514022

1405614023
\pnum
@@ -16540,6 +16507,8 @@
1654016507
template<class... T> struct common_reference;
1654116508
template<class T> struct underlying_type;
1654216509
template<class Fn, class... ArgTypes> struct invoke_result;
16510+
template<class T> struct unwrap_reference;
16511+
template<class T> struct unwrap_ref_decay;
1654316512

1654416513
template<class T>
1654516514
using @\libglobal{type_identity_t}@ = typename type_identity<T>::type;
@@ -16563,6 +16532,10 @@
1656316532
using @\libglobal{underlying_type_t}@ = typename underlying_type<T>::type;
1656416533
template<class Fn, class... ArgTypes>
1656516534
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;
1656616539
template<class...>
1656716540
using @\libglobal{void_t}@ = void;
1656816541

@@ -18104,7 +18077,21 @@
1810418077
\br
1810518078
\requires{} \tcode{Fn} and all types in the template parameter pack \tcode{ArgTypes} shall
1810618079
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>>}.\\
1810818095
\end{libreqtab2a}
1810918096

1811018097
\indexlibraryglobal{aligned_storage}%
@@ -18122,6 +18109,16 @@
1812218109
\end{codeblock}
1812318110
\end{note}
1812418111

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+
1812518122
\indexlibraryglobal{common_type}%
1812618123
\pnum
1812718124
Let:

0 commit comments

Comments
 (0)