Skip to content

Commit b64354a

Browse files
committed
[depr.meta.types] Merge POD deprecation into existing type traits deprecation section and reorganize the section a bit
1 parent 9d8d06a commit b64354a

File tree

1 file changed

+54
-45
lines changed

1 file changed

+54
-45
lines changed

source/future.tex

Lines changed: 54 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2148,38 +2148,80 @@
21482148
\begin{codeblock}
21492149
namespace std {
21502150
template <class T> struct is_literal_type;
2151-
21522151
template <class T> constexpr bool is_literal_type_v = is_literal_type<T>::value;
21532152

2154-
template <class> struct result_of; // not defined
2153+
template <class> struct result_of; // not defined
21552154
template <class Fn, class... ArgTypes> struct result_of<Fn(ArgTypes...)>;
2156-
21572155
template <class T> using result_of_t = typename result_of<T>::type;
2156+
2157+
template <class T> struct is_pod;
2158+
template <class T> inline constexpr bool is_pod_v = is_pod<T>::value;
21582159
}
21592160
\end{codeblock}
21602161

2162+
\pnum
2163+
The behavior of a program that adds specializations for
2164+
any of the templates defined in this subclause is undefined,
2165+
unless explicitly permitted by the specification of the corresponding template.
2166+
2167+
\begin{itemdecl}
2168+
template <class T> struct is_literal_type;
2169+
\end{itemdecl}
2170+
2171+
\begin{itemdescr}
21612172
\pnum
21622173
\requires
2163-
For \tcode{is_literal_type},
21642174
\tcode{remove_all_extents_t<T>} shall be a complete type or \cv{}~\tcode{void}.
2165-
For \tcode{result_of<Fn(ArgTypes...)>},
2166-
\tcode{Fn} and all types in the parameter pack \tcode{ArgTypes} shall be complete types,
2167-
\cv{}~\tcode{void}, or arrays of unknown bound.
21682175

21692176
\pnum
21702177
\tcode{is_literal_type<T>} is a \tcode{UnaryTypeTrait}\iref{meta.rqmts}
21712178
with a base characteristic of \tcode{true_type}
21722179
if \tcode{T} is a literal type\iref{basic.types}, and
21732180
\tcode{false_type} otherwise.
2181+
\end{itemdescr}
2182+
2183+
\begin{itemdecl}
2184+
template <class Fn, class... ArgTypes> struct result_of<Fn(ArgTypes...)>;
2185+
\end{itemdecl}
2186+
2187+
\begin{itemdescr}
2188+
\pnum
2189+
\requires
2190+
\tcode{Fn} and all types in the parameter pack \tcode{ArgTypes} shall be complete types,
2191+
\cv{}~\tcode{void}, or arrays of unknown bound.
2192+
2193+
\pnum
21742194
The partial specialization \tcode{result_of<Fn(ArgTypes...)>} is a
2175-
\tcode{TransformationTrait} whose member typedef \tcode{type} is defined
2176-
if and only if \tcode{invoke_result<Fn, ArgTypes...>::type} is defined.
2195+
\tcode{TransformationTrait}\iref{meta.rqmts} whose member typedef \tcode{type} is defined
2196+
if and only if \tcode{invoke_result<Fn, ArgTypes...>::type}\iref{func.invoke} is defined.
21772197
If \tcode{type} is defined, it names the same type as \tcode{invoke_result_t<Fn, ArgTypes...>}.
2198+
\end{itemdescr}
2199+
2200+
\begin{itemdecl}
2201+
template <class T> struct is_pod;
2202+
\end{itemdecl}
21782203

2204+
\begin{itemdescr}
21792205
\pnum
2180-
The behavior of a program that adds specializations for
2181-
any of the templates defined in this subclause is undefined,
2182-
unless explicitly permitted by the specification of the corresponding template.
2206+
\requires
2207+
\tcode{remove_all_extents_t<T>} shall be a complete type or \cv{} \tcode{void}.
2208+
2209+
\pnum
2210+
\tcode{is_pod<T>} is a \tcode{UnaryTypeTrait}\iref{meta.rqmts}
2211+
with a base characteristic of \tcode{true_type}
2212+
if \tcode{T} is a POD type,
2213+
and \tcode{false_type} otherwise.
2214+
\indextext{POD}%
2215+
A POD class is a class that is both a trivial class and a standard-layout class,
2216+
and has no non-static data members of type non-POD class (or array thereof).
2217+
A POD type is a scalar type, a POD class, an array of such a type,
2218+
or a cv-qualified version of one of these types.
2219+
2220+
\pnum
2221+
\begin{note}
2222+
It is unspecified whether a closure type\iref{expr.prim.lambda.closure} is a POD type.
2223+
\end{note}
2224+
\end{itemdescr}
21832225

21842226
\rSec1[depr.iterator.primitives]{Deprecated iterator primitives}
21852227

@@ -3016,36 +3058,3 @@
30163058
\pnum
30173059
\effects The destructor shall delete \tcode{cvtptr}.
30183060
\end{itemdescr}
3019-
3020-
\rSec1[depr.ispod]{Identification of POD types}
3021-
\indexlibrary{\idxcode{is_pod}}%
3022-
3023-
\pnum
3024-
The following type property
3025-
is defined in header \indexhdr{type_traits}\tcode{<type_traits>}
3026-
in addition to those defined in \ref{meta.unary.prop}:
3027-
3028-
\begin{itemdecl}
3029-
template <class T> struct is_pod;
3030-
template <class T> inline constexpr bool is_pod_v = is_pod<T>::value;
3031-
\end{itemdecl}
3032-
3033-
\begin{itemdescr}
3034-
\pnum
3035-
\requires
3036-
\tcode{remove_all_extents_t<T>} shall be a complete type or \cv{} \tcode{void}.
3037-
3038-
\pnum
3039-
\tcode{is_pod<T>} is a \tcode{UnaryTypeTrait}\iref{meta.rqmts}
3040-
with a base characteristic of \tcode{true_type}
3041-
if \tcode{T} is a POD type,
3042-
and \tcode{false_type} otherwise.
3043-
\indextext{POD}%
3044-
A POD class is a class that is both a trivial class and a standard-layout class,
3045-
and has no non-static data members of type non-POD class (or array thereof).
3046-
A POD type is a scalar type, a POD class, an array of such a type,
3047-
or a cv-qualified version of one of these types.
3048-
\begin{note}
3049-
It is unspecified whether a closure type\iref{expr.prim.lambda.closure} is a POD type.
3050-
\end{note}
3051-
\end{itemdescr}

0 commit comments

Comments
 (0)