|
2148 | 2148 | \begin{codeblock}
|
2149 | 2149 | namespace std {
|
2150 | 2150 | template <class T> struct is_literal_type;
|
2151 |
| - |
2152 | 2151 | template <class T> constexpr bool is_literal_type_v = is_literal_type<T>::value;
|
2153 | 2152 |
|
2154 |
| - template <class> struct result_of; // not defined |
| 2153 | + template <class> struct result_of; // not defined |
2155 | 2154 | template <class Fn, class... ArgTypes> struct result_of<Fn(ArgTypes...)>;
|
2156 |
| - |
2157 | 2155 | 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; |
2158 | 2159 | }
|
2159 | 2160 | \end{codeblock}
|
2160 | 2161 |
|
| 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} |
2161 | 2172 | \pnum
|
2162 | 2173 | \requires
|
2163 |
| -For \tcode{is_literal_type}, |
2164 | 2174 | \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. |
2168 | 2175 |
|
2169 | 2176 | \pnum
|
2170 | 2177 | \tcode{is_literal_type<T>} is a \tcode{UnaryTypeTrait}\iref{meta.rqmts}
|
2171 | 2178 | with a base characteristic of \tcode{true_type}
|
2172 | 2179 | if \tcode{T} is a literal type\iref{basic.types}, and
|
2173 | 2180 | \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 |
2174 | 2194 | 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. |
2177 | 2197 | 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} |
2178 | 2203 |
|
| 2204 | +\begin{itemdescr} |
2179 | 2205 | \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} |
2183 | 2225 |
|
2184 | 2226 | \rSec1[depr.iterator.primitives]{Deprecated iterator primitives}
|
2185 | 2227 |
|
|
3016 | 3058 | \pnum
|
3017 | 3059 | \effects The destructor shall delete \tcode{cvtptr}.
|
3018 | 3060 | \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