From Jason Turner

[meta.type.synop]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpcue_c9p6/{from.md → to.md} +217 -27
tmp/tmpcue_c9p6/{from.md → to.md} RENAMED
@@ -1,15 +1,18 @@
1
  ### Header `<type_traits>` synopsis <a id="meta.type.synop">[[meta.type.synop]]</a>
2
 
3
  ``` cpp
4
  namespace std {
5
- // [meta.help], helper class:
6
  template <class T, T v> struct integral_constant;
7
- typedef integral_constant<bool, true> true_type;
8
- typedef integral_constant<bool, false> false_type;
9
 
10
- // [meta.unary.cat], primary type categories:
 
 
 
 
 
11
  template <class T> struct is_void;
12
  template <class T> struct is_null_pointer;
13
  template <class T> struct is_integral;
14
  template <class T> struct is_floating_point;
15
  template <class T> struct is_array;
@@ -21,31 +24,31 @@ namespace std {
21
  template <class T> struct is_enum;
22
  template <class T> struct is_union;
23
  template <class T> struct is_class;
24
  template <class T> struct is_function;
25
 
26
- // [meta.unary.comp], composite type categories:
27
  template <class T> struct is_reference;
28
  template <class T> struct is_arithmetic;
29
  template <class T> struct is_fundamental;
30
  template <class T> struct is_object;
31
  template <class T> struct is_scalar;
32
  template <class T> struct is_compound;
33
  template <class T> struct is_member_pointer;
34
 
35
- // [meta.unary.prop], type properties:
36
  template <class T> struct is_const;
37
  template <class T> struct is_volatile;
38
  template <class T> struct is_trivial;
39
  template <class T> struct is_trivially_copyable;
40
  template <class T> struct is_standard_layout;
41
  template <class T> struct is_pod;
42
- template <class T> struct is_literal_type;
43
  template <class T> struct is_empty;
44
  template <class T> struct is_polymorphic;
45
  template <class T> struct is_abstract;
46
  template <class T> struct is_final;
 
47
 
48
  template <class T> struct is_signed;
49
  template <class T> struct is_unsigned;
50
 
51
  template <class T, class... Args> struct is_constructible;
@@ -55,10 +58,13 @@ namespace std {
55
 
56
  template <class T, class U> struct is_assignable;
57
  template <class T> struct is_copy_assignable;
58
  template <class T> struct is_move_assignable;
59
 
 
 
 
60
  template <class T> struct is_destructible;
61
 
62
  template <class T, class... Args> struct is_trivially_constructible;
63
  template <class T> struct is_trivially_default_constructible;
64
  template <class T> struct is_trivially_copy_constructible;
@@ -76,24 +82,36 @@ namespace std {
76
 
77
  template <class T, class U> struct is_nothrow_assignable;
78
  template <class T> struct is_nothrow_copy_assignable;
79
  template <class T> struct is_nothrow_move_assignable;
80
 
 
 
 
81
  template <class T> struct is_nothrow_destructible;
 
82
  template <class T> struct has_virtual_destructor;
83
 
84
- // [meta.unary.prop.query], type property queries:
 
 
85
  template <class T> struct alignment_of;
86
  template <class T> struct rank;
87
  template <class T, unsigned I = 0> struct extent;
88
 
89
- // [meta.rel], type relations:
90
  template <class T, class U> struct is_same;
91
  template <class Base, class Derived> struct is_base_of;
92
  template <class From, class To> struct is_convertible;
93
 
94
- // [meta.trans.cv], const-volatile modifications:
 
 
 
 
 
 
95
  template <class T> struct remove_const;
96
  template <class T> struct remove_volatile;
97
  template <class T> struct remove_cv;
98
  template <class T> struct add_const;
99
  template <class T> struct add_volatile;
@@ -110,11 +128,11 @@ namespace std {
110
  template <class T>
111
  using add_volatile_t = typename add_volatile<T>::type;
112
  template <class T>
113
  using add_cv_t = typename add_cv<T>::type;
114
 
115
- // [meta.trans.ref], reference modifications:
116
  template <class T> struct remove_reference;
117
  template <class T> struct add_lvalue_reference;
118
  template <class T> struct add_rvalue_reference;
119
 
120
  template <class T>
@@ -122,54 +140,53 @@ namespace std {
122
  template <class T>
123
  using add_lvalue_reference_t = typename add_lvalue_reference<T>::type;
124
  template <class T>
125
  using add_rvalue_reference_t = typename add_rvalue_reference<T>::type;
126
 
127
- // [meta.trans.sign], sign modifications:
128
  template <class T> struct make_signed;
129
  template <class T> struct make_unsigned;
130
 
131
  template <class T>
132
  using make_signed_t = typename make_signed<T>::type;
133
  template <class T>
134
  using make_unsigned_t = typename make_unsigned<T>::type;
135
 
136
- // [meta.trans.arr], array modifications:
137
  template <class T> struct remove_extent;
138
  template <class T> struct remove_all_extents;
139
 
140
  template <class T>
141
  using remove_extent_t = typename remove_extent<T>::type;
142
  template <class T>
143
  using remove_all_extents_t = typename remove_all_extents<T>::type;
144
 
145
- // [meta.trans.ptr], pointer modifications:
146
  template <class T> struct remove_pointer;
147
  template <class T> struct add_pointer;
148
 
149
  template <class T>
150
  using remove_pointer_t = typename remove_pointer<T>::type;
151
  template <class T>
152
  using add_pointer_t = typename add_pointer<T>::type;
153
 
154
- // [meta.trans.other], other transformations:
155
- template <std::size_t Len,
156
- std::size_t Align = default-alignment> // see [meta.trans.other]
157
  struct aligned_storage;
158
- template <std::size_t Len, class... Types> struct aligned_union;
159
  template <class T> struct decay;
160
  template <bool, class T = void> struct enable_if;
161
  template <bool, class T, class F> struct conditional;
162
  template <class... T> struct common_type;
163
  template <class T> struct underlying_type;
164
- template <class> class result_of; // not defined
165
- template <class F, class... ArgTypes> class result_of<F(ArgTypes...)>;
166
 
167
- template <std::size_t Len,
168
- std::size_t Align = default-alignment > // see [meta.trans.other]
169
  using aligned_storage_t = typename aligned_storage<Len, Align>::type;
170
- template <std::size_t Len, class... Types>
171
  using aligned_union_t = typename aligned_union<Len, Types...>::type;
172
  template <class T>
173
  using decay_t = typename decay<T>::type;
174
  template <bool b, class T = void>
175
  using enable_if_t = typename enable_if<b, T>::type;
@@ -177,14 +194,187 @@ namespace std {
177
  using conditional_t = typename conditional<b, T, F>::type;
178
  template <class... T>
179
  using common_type_t = typename common_type<T...>::type;
180
  template <class T>
181
  using underlying_type_t = typename underlying_type<T>::type;
182
- template <class T>
183
- using result_of_t = typename result_of<T>::type;
184
- } // namespace std
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  ```
186
 
187
- The behavior of a program that adds specializations for any of the class
188
  templates defined in this subclause is undefined unless otherwise
189
  specified.
190
 
 
 
 
 
1
  ### Header `<type_traits>` synopsis <a id="meta.type.synop">[[meta.type.synop]]</a>
2
 
3
  ``` cpp
4
  namespace std {
5
+ // [meta.help], helper class
6
  template <class T, T v> struct integral_constant;
 
 
7
 
8
+ template <bool B>
9
+ using bool_constant = integral_constant<bool, B>;
10
+ using true_type = bool_constant<true>;
11
+ using false_type = bool_constant<false>;
12
+
13
+ // [meta.unary.cat], primary type categories
14
  template <class T> struct is_void;
15
  template <class T> struct is_null_pointer;
16
  template <class T> struct is_integral;
17
  template <class T> struct is_floating_point;
18
  template <class T> struct is_array;
 
24
  template <class T> struct is_enum;
25
  template <class T> struct is_union;
26
  template <class T> struct is_class;
27
  template <class T> struct is_function;
28
 
29
+ // [meta.unary.comp], composite type categories
30
  template <class T> struct is_reference;
31
  template <class T> struct is_arithmetic;
32
  template <class T> struct is_fundamental;
33
  template <class T> struct is_object;
34
  template <class T> struct is_scalar;
35
  template <class T> struct is_compound;
36
  template <class T> struct is_member_pointer;
37
 
38
+ // [meta.unary.prop], type properties
39
  template <class T> struct is_const;
40
  template <class T> struct is_volatile;
41
  template <class T> struct is_trivial;
42
  template <class T> struct is_trivially_copyable;
43
  template <class T> struct is_standard_layout;
44
  template <class T> struct is_pod;
 
45
  template <class T> struct is_empty;
46
  template <class T> struct is_polymorphic;
47
  template <class T> struct is_abstract;
48
  template <class T> struct is_final;
49
+ template <class T> struct is_aggregate;
50
 
51
  template <class T> struct is_signed;
52
  template <class T> struct is_unsigned;
53
 
54
  template <class T, class... Args> struct is_constructible;
 
58
 
59
  template <class T, class U> struct is_assignable;
60
  template <class T> struct is_copy_assignable;
61
  template <class T> struct is_move_assignable;
62
 
63
+ template <class T, class U> struct is_swappable_with;
64
+ template <class T> struct is_swappable;
65
+
66
  template <class T> struct is_destructible;
67
 
68
  template <class T, class... Args> struct is_trivially_constructible;
69
  template <class T> struct is_trivially_default_constructible;
70
  template <class T> struct is_trivially_copy_constructible;
 
82
 
83
  template <class T, class U> struct is_nothrow_assignable;
84
  template <class T> struct is_nothrow_copy_assignable;
85
  template <class T> struct is_nothrow_move_assignable;
86
 
87
+ template <class T, class U> struct is_nothrow_swappable_with;
88
+ template <class T> struct is_nothrow_swappable;
89
+
90
  template <class T> struct is_nothrow_destructible;
91
+
92
  template <class T> struct has_virtual_destructor;
93
 
94
+ template <class T> struct has_unique_object_representations;
95
+
96
+ // [meta.unary.prop.query], type property queries
97
  template <class T> struct alignment_of;
98
  template <class T> struct rank;
99
  template <class T, unsigned I = 0> struct extent;
100
 
101
+ // [meta.rel], type relations
102
  template <class T, class U> struct is_same;
103
  template <class Base, class Derived> struct is_base_of;
104
  template <class From, class To> struct is_convertible;
105
 
106
+ template <class Fn, class... ArgTypes> struct is_invocable;
107
+ template <class R, class Fn, class... ArgTypes> struct is_invocable_r;
108
+
109
+ template <class Fn, class... ArgTypes> struct is_nothrow_invocable;
110
+ template <class R, class Fn, class... ArgTypes> struct is_nothrow_invocable_r;
111
+
112
+ // [meta.trans.cv], const-volatile modifications
113
  template <class T> struct remove_const;
114
  template <class T> struct remove_volatile;
115
  template <class T> struct remove_cv;
116
  template <class T> struct add_const;
117
  template <class T> struct add_volatile;
 
128
  template <class T>
129
  using add_volatile_t = typename add_volatile<T>::type;
130
  template <class T>
131
  using add_cv_t = typename add_cv<T>::type;
132
 
133
+ // [meta.trans.ref], reference modifications
134
  template <class T> struct remove_reference;
135
  template <class T> struct add_lvalue_reference;
136
  template <class T> struct add_rvalue_reference;
137
 
138
  template <class T>
 
140
  template <class T>
141
  using add_lvalue_reference_t = typename add_lvalue_reference<T>::type;
142
  template <class T>
143
  using add_rvalue_reference_t = typename add_rvalue_reference<T>::type;
144
 
145
+ // [meta.trans.sign], sign modifications
146
  template <class T> struct make_signed;
147
  template <class T> struct make_unsigned;
148
 
149
  template <class T>
150
  using make_signed_t = typename make_signed<T>::type;
151
  template <class T>
152
  using make_unsigned_t = typename make_unsigned<T>::type;
153
 
154
+ // [meta.trans.arr], array modifications
155
  template <class T> struct remove_extent;
156
  template <class T> struct remove_all_extents;
157
 
158
  template <class T>
159
  using remove_extent_t = typename remove_extent<T>::type;
160
  template <class T>
161
  using remove_all_extents_t = typename remove_all_extents<T>::type;
162
 
163
+ // [meta.trans.ptr], pointer modifications
164
  template <class T> struct remove_pointer;
165
  template <class T> struct add_pointer;
166
 
167
  template <class T>
168
  using remove_pointer_t = typename remove_pointer<T>::type;
169
  template <class T>
170
  using add_pointer_t = typename add_pointer<T>::type;
171
 
172
+ // [meta.trans.other], other transformations
173
+ template <size_t Len,
174
+ size_t Align = default-alignment> // see [meta.trans.other]
175
  struct aligned_storage;
176
+ template <size_t Len, class... Types> struct aligned_union;
177
  template <class T> struct decay;
178
  template <bool, class T = void> struct enable_if;
179
  template <bool, class T, class F> struct conditional;
180
  template <class... T> struct common_type;
181
  template <class T> struct underlying_type;
182
+ template <class Fn, class... ArgTypes> struct invoke_result;
 
183
 
184
+ template <size_t Len,
185
+ size_t Align = default-alignment> // see [meta.trans.other]
186
  using aligned_storage_t = typename aligned_storage<Len, Align>::type;
187
+ template <size_t Len, class... Types>
188
  using aligned_union_t = typename aligned_union<Len, Types...>::type;
189
  template <class T>
190
  using decay_t = typename decay<T>::type;
191
  template <bool b, class T = void>
192
  using enable_if_t = typename enable_if<b, T>::type;
 
194
  using conditional_t = typename conditional<b, T, F>::type;
195
  template <class... T>
196
  using common_type_t = typename common_type<T...>::type;
197
  template <class T>
198
  using underlying_type_t = typename underlying_type<T>::type;
199
+ template <class Fn, class... ArgTypes>
200
+ using invoke_result_t = typename invoke_result<Fn, ArgTypes...>::type;
201
+ template <class...>
202
+ using void_t = void;
203
+
204
+ // [meta.logical], logical operator traits
205
+ template<class... B> struct conjunction;
206
+ template<class... B> struct disjunction;
207
+ template<class B> struct negation;
208
+
209
+ // [meta.unary.cat], primary type categories
210
+ template <class T> inline constexpr bool is_void_v
211
+ = is_void<T>::value;
212
+ template <class T> inline constexpr bool is_null_pointer_v
213
+ = is_null_pointer<T>::value;
214
+ template <class T> inline constexpr bool is_integral_v
215
+ = is_integral<T>::value;
216
+ template <class T> inline constexpr bool is_floating_point_v
217
+ = is_floating_point<T>::value;
218
+ template <class T> inline constexpr bool is_array_v
219
+ = is_array<T>::value;
220
+ template <class T> inline constexpr bool is_pointer_v
221
+ = is_pointer<T>::value;
222
+ template <class T> inline constexpr bool is_lvalue_reference_v
223
+ = is_lvalue_reference<T>::value;
224
+ template <class T> inline constexpr bool is_rvalue_reference_v
225
+ = is_rvalue_reference<T>::value;
226
+ template <class T> inline constexpr bool is_member_object_pointer_v
227
+ = is_member_object_pointer<T>::value;
228
+ template <class T> inline constexpr bool is_member_function_pointer_v
229
+ = is_member_function_pointer<T>::value;
230
+ template <class T> inline constexpr bool is_enum_v
231
+ = is_enum<T>::value;
232
+ template <class T> inline constexpr bool is_union_v
233
+ = is_union<T>::value;
234
+ template <class T> inline constexpr bool is_class_v
235
+ = is_class<T>::value;
236
+ template <class T> inline constexpr bool is_function_v
237
+ = is_function<T>::value;
238
+
239
+ // [meta.unary.comp], composite type categories
240
+ template <class T> inline constexpr bool is_reference_v
241
+ = is_reference<T>::value;
242
+ template <class T> inline constexpr bool is_arithmetic_v
243
+ = is_arithmetic<T>::value;
244
+ template <class T> inline constexpr bool is_fundamental_v
245
+ = is_fundamental<T>::value;
246
+ template <class T> inline constexpr bool is_object_v
247
+ = is_object<T>::value;
248
+ template <class T> inline constexpr bool is_scalar_v
249
+ = is_scalar<T>::value;
250
+ template <class T> inline constexpr bool is_compound_v
251
+ = is_compound<T>::value;
252
+ template <class T> inline constexpr bool is_member_pointer_v
253
+ = is_member_pointer<T>::value;
254
+
255
+ // [meta.unary.prop], type properties
256
+ template <class T> inline constexpr bool is_const_v
257
+ = is_const<T>::value;
258
+ template <class T> inline constexpr bool is_volatile_v
259
+ = is_volatile<T>::value;
260
+ template <class T> inline constexpr bool is_trivial_v
261
+ = is_trivial<T>::value;
262
+ template <class T> inline constexpr bool is_trivially_copyable_v
263
+ = is_trivially_copyable<T>::value;
264
+ template <class T> inline constexpr bool is_standard_layout_v
265
+ = is_standard_layout<T>::value;
266
+ template <class T> inline constexpr bool is_pod_v
267
+ = is_pod<T>::value;
268
+ template <class T> inline constexpr bool is_empty_v
269
+ = is_empty<T>::value;
270
+ template <class T> inline constexpr bool is_polymorphic_v
271
+ = is_polymorphic<T>::value;
272
+ template <class T> inline constexpr bool is_abstract_v
273
+ = is_abstract<T>::value;
274
+ template <class T> inline constexpr bool is_final_v
275
+ = is_final<T>::value;
276
+ template <class T> inline constexpr bool is_aggregate_v
277
+ = is_aggregate<T>::value;
278
+ template <class T> inline constexpr bool is_signed_v
279
+ = is_signed<T>::value;
280
+ template <class T> inline constexpr bool is_unsigned_v
281
+ = is_unsigned<T>::value;
282
+ template <class T, class... Args> inline constexpr bool is_constructible_v
283
+ = is_constructible<T, Args...>::value;
284
+ template <class T> inline constexpr bool is_default_constructible_v
285
+ = is_default_constructible<T>::value;
286
+ template <class T> inline constexpr bool is_copy_constructible_v
287
+ = is_copy_constructible<T>::value;
288
+ template <class T> inline constexpr bool is_move_constructible_v
289
+ = is_move_constructible<T>::value;
290
+ template <class T, class U> inline constexpr bool is_assignable_v
291
+ = is_assignable<T, U>::value;
292
+ template <class T> inline constexpr bool is_copy_assignable_v
293
+ = is_copy_assignable<T>::value;
294
+ template <class T> inline constexpr bool is_move_assignable_v
295
+ = is_move_assignable<T>::value;
296
+ template <class T, class U> inline constexpr bool is_swappable_with_v
297
+ = is_swappable_with<T, U>::value;
298
+ template <class T> inline constexpr bool is_swappable_v
299
+ = is_swappable<T>::value;
300
+ template <class T> inline constexpr bool is_destructible_v
301
+ = is_destructible<T>::value;
302
+ template <class T, class... Args> inline constexpr bool is_trivially_constructible_v
303
+ = is_trivially_constructible<T, Args...>::value;
304
+ template <class T> inline constexpr bool is_trivially_default_constructible_v
305
+ = is_trivially_default_constructible<T>::value;
306
+ template <class T> inline constexpr bool is_trivially_copy_constructible_v
307
+ = is_trivially_copy_constructible<T>::value;
308
+ template <class T> inline constexpr bool is_trivially_move_constructible_v
309
+ = is_trivially_move_constructible<T>::value;
310
+ template <class T, class U> inline constexpr bool is_trivially_assignable_v
311
+ = is_trivially_assignable<T, U>::value;
312
+ template <class T> inline constexpr bool is_trivially_copy_assignable_v
313
+ = is_trivially_copy_assignable<T>::value;
314
+ template <class T> inline constexpr bool is_trivially_move_assignable_v
315
+ = is_trivially_move_assignable<T>::value;
316
+ template <class T> inline constexpr bool is_trivially_destructible_v
317
+ = is_trivially_destructible<T>::value;
318
+ template <class T, class... Args> inline constexpr bool is_nothrow_constructible_v
319
+ = is_nothrow_constructible<T, Args...>::value;
320
+ template <class T> inline constexpr bool is_nothrow_default_constructible_v
321
+ = is_nothrow_default_constructible<T>::value;
322
+ template <class T> inline constexpr bool is_nothrow_copy_constructible_v
323
+ = is_nothrow_copy_constructible<T>::value;
324
+ template <class T> inline constexpr bool is_nothrow_move_constructible_v
325
+ = is_nothrow_move_constructible<T>::value;
326
+ template <class T, class U> inline constexpr bool is_nothrow_assignable_v
327
+ = is_nothrow_assignable<T, U>::value;
328
+ template <class T> inline constexpr bool is_nothrow_copy_assignable_v
329
+ = is_nothrow_copy_assignable<T>::value;
330
+ template <class T> inline constexpr bool is_nothrow_move_assignable_v
331
+ = is_nothrow_move_assignable<T>::value;
332
+ template <class T, class U> inline constexpr bool is_nothrow_swappable_with_v
333
+ = is_nothrow_swappable_with<T, U>::value;
334
+ template <class T> inline constexpr bool is_nothrow_swappable_v
335
+ = is_nothrow_swappable<T>::value;
336
+ template <class T> inline constexpr bool is_nothrow_destructible_v
337
+ = is_nothrow_destructible<T>::value;
338
+ template <class T> inline constexpr bool has_virtual_destructor_v
339
+ = has_virtual_destructor<T>::value;
340
+ template <class T> inline constexpr bool has_unique_object_representations_v
341
+ = has_unique_object_representations<T>::value;
342
+
343
+ // [meta.unary.prop.query], type property queries
344
+ template <class T> inline constexpr size_t alignment_of_v
345
+ = alignment_of<T>::value;
346
+ template <class T> inline constexpr size_t rank_v
347
+ = rank<T>::value;
348
+ template <class T, unsigned I = 0> inline constexpr size_t extent_v
349
+ = extent<T, I>::value;
350
+
351
+ // [meta.rel], type relations
352
+ template <class T, class U> inline constexpr bool is_same_v
353
+ = is_same<T, U>::value;
354
+ template <class Base, class Derived> inline constexpr bool is_base_of_v
355
+ = is_base_of<Base, Derived>::value;
356
+ template <class From, class To> inline constexpr bool is_convertible_v
357
+ = is_convertible<From, To>::value;
358
+ template <class Fn, class... ArgTypes> inline constexpr bool is_invocable_v
359
+ = is_invocable<Fn, ArgTypes...>::value;
360
+ template <class R, class Fn, class... ArgTypes> inline constexpr bool is_invocable_r_v
361
+ = is_invocable_r<R, Fn, ArgTypes...>::value;
362
+ template <class Fn, class... ArgTypes> inline constexpr bool is_nothrow_invocable_v
363
+ = is_nothrow_invocable<Fn, ArgTypes...>::value;
364
+ template <class R, class Fn, class... ArgTypes> inline constexpr bool is_nothrow_invocable_r_v
365
+ = is_nothrow_invocable_r<R, Fn, ArgTypes...>::value;
366
+
367
+ // [meta.logical], logical operator traits
368
+ template<class... B> inline constexpr bool conjunction_v = conjunction<B...>::value;
369
+ template<class... B> inline constexpr bool disjunction_v = disjunction<B...>::value;
370
+ template<class B> inline constexpr bool negation_v = negation<B>::value;
371
+ }
372
  ```
373
 
374
+ The behavior of a program that adds specializations for any of the
375
  templates defined in this subclause is undefined unless otherwise
376
  specified.
377
 
378
+ Unless otherwise specified, an incomplete type may be used to
379
+ instantiate a template in this subclause.
380
+