-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathtype_traits
2596 lines (2075 loc) · 106 KB
/
type_traits
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// type_traits standard header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef _TYPE_TRAITS_
#define _TYPE_TRAITS_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <cstddef>
#include <cstdint>
#include <xtr1common>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
// TRANSITION, non-_Ugly attribute tokens
#pragma push_macro("msvc")
#pragma push_macro("intrinsic")
#pragma push_macro("known_semantics")
#undef msvc
#undef intrinsic
#undef known_semantics
_STD_BEGIN
template <class>
// TRANSITION, CWG-2518: false value attached to a dependent name (for static_assert)
_INLINE_VAR constexpr bool _Always_false = false;
template <bool _First_value, class _First, class... _Rest>
struct _Conjunction { // handle false trait or last trait
using type = _First;
};
template <class _True, class _Next, class... _Rest>
struct _Conjunction<true, _True, _Next, _Rest...> { // the first trait is true, try the next one
using type = typename _Conjunction<_Next::value, _Next, _Rest...>::type;
};
_EXPORT_STD template <class... _Traits>
struct conjunction : true_type {}; // If _Traits is empty, true_type
template <class _First, class... _Rest>
struct conjunction<_First, _Rest...> : _Conjunction<_First::value, _First, _Rest...>::type {
// the first false trait in _Traits, or the last trait if none are false
};
_EXPORT_STD template <class... _Traits>
_INLINE_VAR constexpr bool conjunction_v = conjunction<_Traits...>::value;
_EXPORT_STD template <class _Trait>
struct negation : bool_constant<!static_cast<bool>(_Trait::value)> {}; // The negated result of _Trait
_EXPORT_STD template <class _Trait>
_INLINE_VAR constexpr bool negation_v = negation<_Trait>::value;
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_void_v = is_same_v<remove_cv_t<_Ty>, void>;
_EXPORT_STD template <class _Ty>
struct is_void : bool_constant<is_void_v<_Ty>> {};
_EXPORT_STD template <class... _Types>
using void_t = void;
template <class _Ty>
struct _Identity {
using type = _Ty;
};
template <class _Ty>
using _Identity_t _MSVC_KNOWN_SEMANTICS = typename _Identity<_Ty>::type;
// Type modifiers
_EXPORT_STD template <class _Ty>
struct add_const { // add top-level const qualifier
using type = const _Ty;
};
_EXPORT_STD template <class _Ty>
using add_const_t = typename add_const<_Ty>::type;
_EXPORT_STD template <class _Ty>
struct add_volatile { // add top-level volatile qualifier
using type = volatile _Ty;
};
_EXPORT_STD template <class _Ty>
using add_volatile_t = typename add_volatile<_Ty>::type;
_EXPORT_STD template <class _Ty>
struct add_cv { // add top-level const and volatile qualifiers
using type = const volatile _Ty;
};
_EXPORT_STD template <class _Ty>
using add_cv_t = typename add_cv<_Ty>::type;
template <class _Ty, class = void>
struct _Add_reference { // add reference (non-referenceable type)
using _Lvalue = _Ty;
using _Rvalue = _Ty;
};
template <class _Ty>
struct _Add_reference<_Ty, void_t<_Ty&>> { // (referenceable type)
using _Lvalue = _Ty&;
using _Rvalue = _Ty&&;
};
_EXPORT_STD template <class _Ty>
struct add_lvalue_reference {
using type = typename _Add_reference<_Ty>::_Lvalue;
};
_EXPORT_STD template <class _Ty>
using add_lvalue_reference_t = typename _Add_reference<_Ty>::_Lvalue;
_EXPORT_STD template <class _Ty>
struct add_rvalue_reference {
using type = typename _Add_reference<_Ty>::_Rvalue;
};
_EXPORT_STD template <class _Ty>
using add_rvalue_reference_t = typename _Add_reference<_Ty>::_Rvalue;
_EXPORT_STD template <class _Ty>
add_rvalue_reference_t<_Ty> declval() noexcept {
static_assert(_Always_false<_Ty>, "Calling declval is ill-formed, see N4950 [declval]/2.");
}
_EXPORT_STD template <class _Ty>
struct remove_extent { // remove array extent
using type = _Ty;
};
template <class _Ty, size_t _Ix>
struct remove_extent<_Ty[_Ix]> {
using type = _Ty;
};
template <class _Ty>
struct remove_extent<_Ty[]> {
using type = _Ty;
};
_EXPORT_STD template <class _Ty>
using remove_extent_t = typename remove_extent<_Ty>::type;
_EXPORT_STD template <class _Ty>
struct remove_all_extents { // remove all array extents
using type = _Ty;
};
template <class _Ty, size_t _Ix>
struct remove_all_extents<_Ty[_Ix]> {
using type = typename remove_all_extents<_Ty>::type;
};
template <class _Ty>
struct remove_all_extents<_Ty[]> {
using type = typename remove_all_extents<_Ty>::type;
};
_EXPORT_STD template <class _Ty>
using remove_all_extents_t = typename remove_all_extents<_Ty>::type;
_EXPORT_STD template <class _Ty>
struct remove_pointer {
using type = _Ty;
};
template <class _Ty>
struct remove_pointer<_Ty*> {
using type = _Ty;
};
template <class _Ty>
struct remove_pointer<_Ty* const> {
using type = _Ty;
};
template <class _Ty>
struct remove_pointer<_Ty* volatile> {
using type = _Ty;
};
template <class _Ty>
struct remove_pointer<_Ty* const volatile> {
using type = _Ty;
};
_EXPORT_STD template <class _Ty>
using remove_pointer_t = typename remove_pointer<_Ty>::type;
template <class _Ty, class = void>
struct _Add_pointer { // add pointer (pointer type cannot be formed)
using type = _Ty;
};
template <class _Ty>
struct _Add_pointer<_Ty, void_t<remove_reference_t<_Ty>*>> { // (pointer type can be formed)
using type = remove_reference_t<_Ty>*;
};
_EXPORT_STD template <class _Ty>
struct add_pointer {
using type = typename _Add_pointer<_Ty>::type;
};
_EXPORT_STD template <class _Ty>
using add_pointer_t = typename _Add_pointer<_Ty>::type;
_EXPORT_STD template <class>
_INLINE_VAR constexpr bool is_array_v = false; // determine whether type argument is an array
template <class _Ty, size_t _Nx>
_INLINE_VAR constexpr bool is_array_v<_Ty[_Nx]> = true;
template <class _Ty>
_INLINE_VAR constexpr bool is_array_v<_Ty[]> = true;
_EXPORT_STD template <class _Ty>
struct is_array : bool_constant<is_array_v<_Ty>> {};
#if _HAS_CXX20
_EXPORT_STD template <class>
inline constexpr bool is_bounded_array_v = false;
template <class _Ty, size_t _Nx>
inline constexpr bool is_bounded_array_v<_Ty[_Nx]> = true;
_EXPORT_STD template <class _Ty>
struct is_bounded_array : bool_constant<is_bounded_array_v<_Ty>> {};
_EXPORT_STD template <class>
inline constexpr bool is_unbounded_array_v = false;
template <class _Ty>
inline constexpr bool is_unbounded_array_v<_Ty[]> = true;
_EXPORT_STD template <class _Ty>
struct is_unbounded_array : bool_constant<is_unbounded_array_v<_Ty>> {};
#endif // _HAS_CXX20
_EXPORT_STD template <class>
_INLINE_VAR constexpr bool is_lvalue_reference_v = false; // determine whether type argument is an lvalue reference
template <class _Ty>
_INLINE_VAR constexpr bool is_lvalue_reference_v<_Ty&> = true;
_EXPORT_STD template <class _Ty>
struct is_lvalue_reference : bool_constant<is_lvalue_reference_v<_Ty>> {};
_EXPORT_STD template <class>
_INLINE_VAR constexpr bool is_rvalue_reference_v = false; // determine whether type argument is an rvalue reference
template <class _Ty>
_INLINE_VAR constexpr bool is_rvalue_reference_v<_Ty&&> = true;
_EXPORT_STD template <class _Ty>
struct is_rvalue_reference : bool_constant<is_rvalue_reference_v<_Ty>> {};
_EXPORT_STD template <class>
_INLINE_VAR constexpr bool is_reference_v = false; // determine whether type argument is a reference
template <class _Ty>
_INLINE_VAR constexpr bool is_reference_v<_Ty&> = true;
template <class _Ty>
_INLINE_VAR constexpr bool is_reference_v<_Ty&&> = true;
_EXPORT_STD template <class _Ty>
struct is_reference : bool_constant<is_reference_v<_Ty>> {};
_EXPORT_STD template <class>
_INLINE_VAR constexpr bool is_pointer_v = false; // determine whether _Ty is a pointer
template <class _Ty>
_INLINE_VAR constexpr bool is_pointer_v<_Ty*> = true;
template <class _Ty>
_INLINE_VAR constexpr bool is_pointer_v<_Ty* const> = true;
template <class _Ty>
_INLINE_VAR constexpr bool is_pointer_v<_Ty* volatile> = true;
template <class _Ty>
_INLINE_VAR constexpr bool is_pointer_v<_Ty* const volatile> = true;
_EXPORT_STD template <class _Ty>
struct is_pointer : bool_constant<is_pointer_v<_Ty>> {};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_null_pointer_v =
is_same_v<remove_cv_t<_Ty>, nullptr_t>; // determine whether _Ty is cv-qualified nullptr_t
_EXPORT_STD template <class _Ty>
struct is_null_pointer : bool_constant<is_null_pointer_v<_Ty>> {};
_EXPORT_STD template <class _Ty>
struct is_union : bool_constant<__is_union(_Ty)> {}; // determine whether _Ty is a union
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_union_v = __is_union(_Ty);
_EXPORT_STD template <class _Ty>
struct is_class : bool_constant<__is_class(_Ty)> {}; // determine whether _Ty is a class
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_class_v = __is_class(_Ty);
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_fundamental_v = is_arithmetic_v<_Ty> || is_void_v<_Ty> || is_null_pointer_v<_Ty>;
_EXPORT_STD template <class _Ty>
struct is_fundamental : bool_constant<is_fundamental_v<_Ty>> {}; // determine whether _Ty is a fundamental type
_EXPORT_STD template <class _From, class _To>
struct is_convertible : bool_constant<__is_convertible_to(_From, _To)> {
// determine whether _From is convertible to _To
};
_EXPORT_STD template <class _From, class _To>
_INLINE_VAR constexpr bool is_convertible_v = __is_convertible_to(_From, _To);
#if !defined(__EDG__) && !defined(__clang__) // TRANSITION, DevCom-1627396
template <class _Ty>
struct is_convertible<_Ty&, volatile _Ty&> : true_type {};
template <class _Ty>
struct is_convertible<volatile _Ty&, volatile _Ty&> : true_type {};
template <class _Ty>
struct is_convertible<_Ty&, const volatile _Ty&> : true_type {};
template <class _Ty>
struct is_convertible<volatile _Ty&, const volatile _Ty&> : true_type {};
template <class _Ty>
_INLINE_VAR constexpr bool is_convertible_v<_Ty&, volatile _Ty&> = true;
template <class _Ty>
_INLINE_VAR constexpr bool is_convertible_v<volatile _Ty&, volatile _Ty&> = true;
template <class _Ty>
_INLINE_VAR constexpr bool is_convertible_v<_Ty&, const volatile _Ty&> = true;
template <class _Ty>
_INLINE_VAR constexpr bool is_convertible_v<volatile _Ty&, const volatile _Ty&> = true;
#endif // ^^^ workaround
_EXPORT_STD template <class _Ty>
struct is_enum : bool_constant<__is_enum(_Ty)> {}; // determine whether _Ty is an enumerated type
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_enum_v = __is_enum(_Ty);
#if _HAS_CXX23
_EXPORT_STD template <class _Ty>
inline constexpr bool is_scoped_enum_v = conjunction_v<is_enum<_Ty>, negation<is_convertible<_Ty, int>>>;
_EXPORT_STD template <class _Ty>
struct is_scoped_enum : bool_constant<is_scoped_enum_v<_Ty>> {};
#endif // _HAS_CXX23
_EXPORT_STD template <class _Ty>
struct is_compound : bool_constant<!is_fundamental_v<_Ty>> {}; // determine whether _Ty is a compound type
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>;
#define _EMIT_CDECL(FUNC, OPT1, OPT2, OPT3) FUNC(__cdecl, OPT1, OPT2, OPT3)
#ifdef _M_CEE
#define _EMIT_CLRCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__clrcall, OPT1, OPT2, OPT3)
#else // ^^^ defined(_M_CEE) / !defined(_M_CEE) vvv
#define _EMIT_CLRCALL(FUNC, OPT1, OPT2, OPT3)
#endif // ^^^ !defined(_M_CEE) ^^^
#if defined(_M_IX86) && !defined(_M_CEE)
#define _EMIT_FASTCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__fastcall, OPT1, OPT2, OPT3)
#else // defined(_M_IX86) && !defined(_M_CEE)
#define _EMIT_FASTCALL(FUNC, OPT1, OPT2, OPT3)
#endif // defined(_M_IX86) && !defined(_M_CEE)
#ifdef _M_IX86
#define _EMIT_STDCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__stdcall, OPT1, OPT2, OPT3)
#define _EMIT_THISCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__thiscall, OPT1, OPT2, OPT3)
#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv
#define _EMIT_STDCALL(FUNC, OPT1, OPT2, OPT3)
#define _EMIT_THISCALL(FUNC, OPT1, OPT2, OPT3)
#endif // ^^^ !defined(_M_IX86) ^^^
#if ((defined(_M_IX86) && _M_IX86_FP >= 2) || defined(_M_X64)) && !defined(_M_CEE)
#define _EMIT_VECTORCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__vectorcall, OPT1, OPT2, OPT3)
#else // defined(_M_IX86) && _M_IX86_FP >= 2 etc.
#define _EMIT_VECTORCALL(FUNC, OPT1, OPT2, OPT3)
#endif // defined(_M_IX86) && _M_IX86_FP >= 2 etc.
#define _NON_MEMBER_CALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \
_EMIT_CDECL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \
_EMIT_CLRCALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \
_EMIT_FASTCALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \
_EMIT_STDCALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \
_EMIT_VECTORCALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT)
#define _NON_MEMBER_CALL_CV(FUNC, REF_OPT, NOEXCEPT_OPT) \
_NON_MEMBER_CALL(FUNC, , REF_OPT, NOEXCEPT_OPT) \
_NON_MEMBER_CALL(FUNC, const, REF_OPT, NOEXCEPT_OPT) \
_NON_MEMBER_CALL(FUNC, volatile, REF_OPT, NOEXCEPT_OPT) \
_NON_MEMBER_CALL(FUNC, const volatile, REF_OPT, NOEXCEPT_OPT)
#define _NON_MEMBER_CALL_CV_REF(FUNC, NOEXCEPT_OPT) \
_NON_MEMBER_CALL_CV(FUNC, , NOEXCEPT_OPT) \
_NON_MEMBER_CALL_CV(FUNC, &, NOEXCEPT_OPT) \
_NON_MEMBER_CALL_CV(FUNC, &&, NOEXCEPT_OPT)
#ifdef __cpp_noexcept_function_type
#define _NON_MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) \
_NON_MEMBER_CALL_CV_REF(FUNC, ) \
_NON_MEMBER_CALL_CV_REF(FUNC, noexcept)
#else // ^^^ defined(__cpp_noexcept_function_type) / !defined(__cpp_noexcept_function_type) vvv
#define _NON_MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) _NON_MEMBER_CALL_CV_REF(FUNC, )
#endif // ^^^ !defined(__cpp_noexcept_function_type) ^^^
#define _MEMBER_CALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \
_EMIT_CDECL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \
_EMIT_CLRCALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \
_EMIT_FASTCALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \
_EMIT_STDCALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \
_EMIT_THISCALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \
_EMIT_VECTORCALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT)
#define _MEMBER_CALL_CV(FUNC, REF_OPT, NOEXCEPT_OPT) \
_MEMBER_CALL(FUNC, , REF_OPT, NOEXCEPT_OPT) \
_MEMBER_CALL(FUNC, const, REF_OPT, NOEXCEPT_OPT) \
_MEMBER_CALL(FUNC, volatile, REF_OPT, NOEXCEPT_OPT) \
_MEMBER_CALL(FUNC, const volatile, REF_OPT, NOEXCEPT_OPT)
#define _MEMBER_CALL_CV_REF(FUNC, NOEXCEPT_OPT) \
_MEMBER_CALL_CV(FUNC, , NOEXCEPT_OPT) \
_MEMBER_CALL_CV(FUNC, &, NOEXCEPT_OPT) \
_MEMBER_CALL_CV(FUNC, &&, NOEXCEPT_OPT)
#ifdef __cpp_noexcept_function_type
#define _MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) \
_MEMBER_CALL_CV_REF(FUNC, ) \
_MEMBER_CALL_CV_REF(FUNC, noexcept)
#else // ^^^ defined(__cpp_noexcept_function_type) / !defined(__cpp_noexcept_function_type) vvv
#define _MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) _MEMBER_CALL_CV_REF(FUNC, )
#endif // ^^^ !defined(__cpp_noexcept_function_type) ^^^
#ifdef __cpp_noexcept_function_type
#define _CLASS_DEFINE_CV_REF_NOEXCEPT(CLASS) \
CLASS(_EMPTY_ARGUMENT) \
CLASS(const) \
CLASS(volatile) \
CLASS(const volatile) \
CLASS(&) \
CLASS(const&) \
CLASS(volatile&) \
CLASS(const volatile&) \
CLASS(&&) \
CLASS(const&&) \
CLASS(volatile&&) \
CLASS(const volatile&&) \
CLASS(noexcept) \
CLASS(const noexcept) \
CLASS(volatile noexcept) \
CLASS(const volatile noexcept) \
CLASS(& noexcept) \
CLASS(const& noexcept) \
CLASS(volatile& noexcept) \
CLASS(const volatile& noexcept) \
CLASS(&& noexcept) \
CLASS(const&& noexcept) \
CLASS(volatile&& noexcept) \
CLASS(const volatile&& noexcept)
#else // ^^^ defined(__cpp_noexcept_function_type) / !defined(__cpp_noexcept_function_type) vvv
#define _CLASS_DEFINE_CV_REF_NOEXCEPT(CLASS) \
CLASS(_EMPTY_ARGUMENT) \
CLASS(const) \
CLASS(volatile) \
CLASS(const volatile) \
CLASS(&) \
CLASS(const&) \
CLASS(volatile&) \
CLASS(const volatile&) \
CLASS(&&) \
CLASS(const&&) \
CLASS(volatile&&) \
CLASS(const volatile&&)
#endif // ^^^ !defined(__cpp_noexcept_function_type) ^^^
template <class... _Types>
struct _Arg_types {}; // provide argument_type, etc. when sizeof...(_Types) is 1 or 2
template <class _Ty1>
struct _Arg_types<_Ty1> {
using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty1;
};
template <class _Ty1, class _Ty2>
struct _Arg_types<_Ty1, _Ty2> {
using _FIRST_ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty1;
using _SECOND_ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty2;
};
template <class _Ty>
struct _Is_memfunptr { // base class for member function pointer predicates
using _Bool_type = false_type; // NB: members are user-visible via _Weak_types
};
#define _IS_MEMFUNPTR(CALL_OPT, CV_OPT, REF_OPT, NOEXCEPT_OPT) \
template <class _Ret, class _Arg0, class... _Types> \
struct _Is_memfunptr<_Ret (CALL_OPT _Arg0::*)(_Types...) CV_OPT REF_OPT NOEXCEPT_OPT> \
: _Arg_types<CV_OPT _Arg0*, _Types...> { \
using _Bool_type = true_type; \
using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ret; \
using _Class_type = _Arg0; \
using _Guide_type = enable_if<!is_same_v<int REF_OPT, int&&>, _Ret(_Types...)>; \
};
_MEMBER_CALL_CV_REF_NOEXCEPT(_IS_MEMFUNPTR)
#undef _IS_MEMFUNPTR
#define _IS_MEMFUNPTR_ELLIPSIS(CV_REF_NOEXCEPT_OPT) \
template <class _Ret, class _Arg0, class... _Types> \
struct _Is_memfunptr<_Ret (_Arg0::*)(_Types..., ...) \
CV_REF_NOEXCEPT_OPT> { /* no calling conventions for ellipsis */ \
using _Bool_type = true_type; \
using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ret; \
using _Class_type = _Arg0; \
using _Guide_type = enable_if<false>; \
};
_CLASS_DEFINE_CV_REF_NOEXCEPT(_IS_MEMFUNPTR_ELLIPSIS)
#undef _IS_MEMFUNPTR_ELLIPSIS
#if _HAS_CXX23 && !defined(__clang__) // TRANSITION, DevCom-10107077, Clang has not implemented Deducing this
#define _IS_MEMFUNPTR_EXPLICIT_THIS_GUIDES(CALL_OPT, CV_OPT, REF_OPT, NOEXCEPT_OPT) \
template <class _Ret, class _Self, class... _Args> \
struct _Is_memfunptr<_Ret(CALL_OPT*)(_Self, _Args...) NOEXCEPT_OPT> { \
using _Bool_type = false_type; \
using _Guide_type = _Identity<_Ret(_Args...)>; \
};
_NON_MEMBER_CALL(_IS_MEMFUNPTR_EXPLICIT_THIS_GUIDES, , , )
#ifdef __cpp_noexcept_function_type
_NON_MEMBER_CALL(_IS_MEMFUNPTR_EXPLICIT_THIS_GUIDES, , , noexcept)
#endif // defined(__cpp_noexcept_function_type)
#undef _IS_MEMFUNPTR_EXPLICIT_THIS_GUIDES
#endif // _HAS_CXX23 && !defined(__clang__)
#ifdef __clang__
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_member_function_pointer_v = __is_member_function_pointer(_Ty);
#else // ^^^ Clang / Other vvv
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_member_function_pointer_v = _Is_memfunptr<remove_cv_t<_Ty>>::_Bool_type::value;
#endif // ^^^ Other ^^^
_EXPORT_STD template <class _Ty>
struct is_member_function_pointer : bool_constant<is_member_function_pointer_v<_Ty>> {};
_EXPORT_STD template <class>
_INLINE_VAR constexpr bool is_const_v = false; // determine whether type argument is const qualified
template <class _Ty>
_INLINE_VAR constexpr bool is_const_v<const _Ty> = true;
_EXPORT_STD template <class _Ty>
struct is_const : bool_constant<is_const_v<_Ty>> {};
_EXPORT_STD template <class>
_INLINE_VAR constexpr bool is_volatile_v = false; // determine whether type argument is volatile qualified
template <class _Ty>
_INLINE_VAR constexpr bool is_volatile_v<volatile _Ty> = true;
_EXPORT_STD template <class _Ty>
struct is_volatile : bool_constant<is_volatile_v<_Ty>> {};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_function_v = // only function types and reference types can't be const qualified
!is_const_v<const _Ty> && !is_reference_v<_Ty>;
_EXPORT_STD template <class _Ty>
struct is_function : bool_constant<is_function_v<_Ty>> {};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_object_v = // only function types and reference types can't be const qualified
is_const_v<const _Ty> && !is_void_v<_Ty>;
_EXPORT_STD template <class _Ty>
struct is_object : bool_constant<is_object_v<_Ty>> {};
template <class>
struct _Is_member_object_pointer {
static constexpr bool value = false;
};
template <class _Ty1, class _Ty2>
struct _Is_member_object_pointer<_Ty1 _Ty2::*> {
static constexpr bool value = !is_function_v<_Ty1>;
using _Class_type = _Ty2;
};
#ifdef __clang__
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_member_object_pointer_v = __is_member_object_pointer(_Ty);
#else // ^^^ Clang / Other vvv
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_member_object_pointer_v = _Is_member_object_pointer<remove_cv_t<_Ty>>::value;
#endif // ^^^ Other ^^^
_EXPORT_STD template <class _Ty>
struct is_member_object_pointer : bool_constant<is_member_object_pointer_v<_Ty>> {};
#ifdef __clang__
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_member_pointer_v = __is_member_pointer(_Ty);
#else // ^^^ Clang / Other vvv
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_member_pointer_v = is_member_object_pointer_v<_Ty> || is_member_function_pointer_v<_Ty>;
#endif // ^^^ Other ^^^
_EXPORT_STD template <class _Ty>
struct is_member_pointer : bool_constant<is_member_pointer_v<_Ty>> {}; // determine whether _Ty is a pointer to member
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_scalar_v = // determine whether _Ty is a scalar type
is_arithmetic_v<_Ty> || is_enum_v<_Ty> || is_pointer_v<_Ty> || is_member_pointer_v<_Ty> || is_null_pointer_v<_Ty>;
_EXPORT_STD template <class _Ty>
struct is_scalar : bool_constant<is_scalar_v<_Ty>> {};
_EXPORT_STD template <class _Ty>
struct _CXX20_DEPRECATE_IS_POD is_pod : bool_constant<__is_pod(_Ty)> {}; // determine whether _Ty is a POD type
_EXPORT_STD template <class _Ty>
_CXX20_DEPRECATE_IS_POD _INLINE_VAR constexpr bool is_pod_v = __is_pod(_Ty);
_EXPORT_STD template <class _Ty>
struct is_empty : bool_constant<__is_empty(_Ty)> {}; // determine whether _Ty is an empty class
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_empty_v = __is_empty(_Ty);
_EXPORT_STD template <class _Ty>
struct is_polymorphic : bool_constant<__is_polymorphic(_Ty)> {}; // determine whether _Ty is a polymorphic type
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_polymorphic_v = __is_polymorphic(_Ty);
_EXPORT_STD template <class _Ty>
struct is_abstract : bool_constant<__is_abstract(_Ty)> {}; // determine whether _Ty is an abstract class
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_abstract_v = __is_abstract(_Ty);
_EXPORT_STD template <class _Ty>
struct is_final : bool_constant<__is_final(_Ty)> {}; // determine whether _Ty is a final class
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_final_v = __is_final(_Ty);
_EXPORT_STD template <class _Ty>
struct is_standard_layout : bool_constant<__is_standard_layout(_Ty)> {}; // determine whether _Ty is standard layout
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_standard_layout_v = __is_standard_layout(_Ty);
#if _HAS_DEPRECATED_IS_LITERAL_TYPE
_EXPORT_STD template <class _Ty>
struct _CXX17_DEPRECATE_IS_LITERAL_TYPE is_literal_type : bool_constant<__is_literal_type(_Ty)> {
// determine whether _Ty is a literal type
};
_EXPORT_STD template <class _Ty>
_CXX17_DEPRECATE_IS_LITERAL_TYPE _INLINE_VAR constexpr bool is_literal_type_v = __is_literal_type(_Ty);
#endif // _HAS_DEPRECATED_IS_LITERAL_TYPE
#if 1 // TRANSITION, VSO-119526 and LLVM-41915
_EXPORT_STD template <class _Ty>
struct is_trivial : bool_constant<__is_trivially_constructible(_Ty) && __is_trivially_copyable(_Ty)> {
// determine whether _Ty is a trivial type
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_trivial_v = __is_trivially_constructible(_Ty) && __is_trivially_copyable(_Ty);
#else // ^^^ workaround / no workaround vvv
_EXPORT_STD template <class _Ty>
struct is_trivial : bool_constant<__is_trivial(_Ty)> {}; // determine whether _Ty is a trivial type
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_trivial_v = __is_trivial(_Ty);
#endif // TRANSITION
_EXPORT_STD template <class _Ty>
struct is_trivially_copyable : bool_constant<__is_trivially_copyable(_Ty)> {
// determine whether _Ty is a trivially copyable type
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_trivially_copyable_v = __is_trivially_copyable(_Ty);
_EXPORT_STD template <class _Ty>
struct has_virtual_destructor : bool_constant<__has_virtual_destructor(_Ty)> {
// determine whether _Ty has a virtual destructor
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool has_virtual_destructor_v = __has_virtual_destructor(_Ty);
#if _HAS_CXX17
_EXPORT_STD template <class _Ty>
struct has_unique_object_representations : bool_constant<__has_unique_object_representations(_Ty)> {
// determine whether _Ty has unique object representations
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool has_unique_object_representations_v = __has_unique_object_representations(_Ty);
#ifdef __EDG__ // TRANSITION, VSO-1690654
template <class _Ty>
struct _Is_aggregate_impl : bool_constant<__is_aggregate(_Ty)> {};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_aggregate_v = disjunction_v<is_array<_Ty>, _Is_aggregate_impl<_Ty>>;
_EXPORT_STD template <class _Ty>
struct is_aggregate : bool_constant<is_aggregate_v<_Ty>> {};
#else // ^^^ workaround / no workaround vvv
_EXPORT_STD template <class _Ty>
struct is_aggregate : bool_constant<__is_aggregate(_Ty)> {};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_aggregate_v = __is_aggregate(_Ty);
#endif // ^^^ no workaround ^^^
#endif // _HAS_CXX17
_EXPORT_STD template <class _Ty, class... _Args>
struct is_constructible : bool_constant<__is_constructible(_Ty, _Args...)> {
// determine whether _Ty can be direct-initialized with _Args...
};
_EXPORT_STD template <class _Ty, class... _Args>
_INLINE_VAR constexpr bool is_constructible_v = __is_constructible(_Ty, _Args...);
_EXPORT_STD template <class _Ty>
struct is_copy_constructible : bool_constant<__is_constructible(_Ty, add_lvalue_reference_t<const _Ty>)> {
// determine whether _Ty can be direct-initialized with an lvalue const _Ty
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_copy_constructible_v = __is_constructible(_Ty, add_lvalue_reference_t<const _Ty>);
_EXPORT_STD template <class _Ty>
struct is_default_constructible : bool_constant<__is_constructible(_Ty)> {
// determine whether _Ty can be value-initialized
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_default_constructible_v = __is_constructible(_Ty);
template <class _Ty, class = void>
struct _Is_implicitly_default_constructible : false_type {
// determine whether _Ty can be copy-initialized with {}
};
template <class _Ty>
void _Implicitly_default_construct(const _Ty&);
template <class _Ty>
struct _Is_implicitly_default_constructible<_Ty, void_t<decltype(_Implicitly_default_construct<_Ty>({}))>> : true_type {
};
_EXPORT_STD template <class _Ty>
struct is_move_constructible : bool_constant<__is_constructible(_Ty, _Ty)> {
// determine whether _Ty can be direct-initialized from an rvalue _Ty
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_move_constructible_v = __is_constructible(_Ty, _Ty);
_EXPORT_STD template <class _To, class _From>
struct is_assignable : bool_constant<__is_assignable(_To, _From)> {}; // determine whether _From can be assigned to _To
_EXPORT_STD template <class _To, class _From>
_INLINE_VAR constexpr bool is_assignable_v = __is_assignable(_To, _From);
#if defined(_IS_ASSIGNABLE_NOCHECK_SUPPORTED) && !defined(__CUDACC__)
template <class _To, class _From>
struct _Is_assignable_no_precondition_check : bool_constant<__is_assignable_no_precondition_check(_To, _From)> {};
#else // ^^^ Use intrinsic / intrinsic not supported vvv
template <class _To, class _From>
using _Is_assignable_no_precondition_check = is_assignable<_To, _From>;
#endif // defined(_IS_ASSIGNABLE_NOCHECK_SUPPORTED) && !defined(__CUDACC__)
_EXPORT_STD template <class _Ty>
struct is_copy_assignable
: bool_constant<__is_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t<const _Ty>)> {
// determine whether an lvalue const _Ty can be assigned to an lvalue _Ty
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_copy_assignable_v =
__is_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t<const _Ty>);
#if defined(_IS_ASSIGNABLE_NOCHECK_SUPPORTED) && !defined(__CUDACC__)
template <class _Ty>
struct _Is_copy_assignable_no_precondition_check
: bool_constant<__is_assignable_no_precondition_check(
add_lvalue_reference_t<_Ty>, add_lvalue_reference_t<const _Ty>)> {};
template <class _Ty>
_INLINE_VAR constexpr bool _Is_copy_assignable_unchecked_v =
__is_assignable_no_precondition_check(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t<const _Ty>);
#else // ^^^ Use intrinsic / intrinsic not supported vvv
template <class _Ty>
using _Is_copy_assignable_no_precondition_check = is_copy_assignable<_Ty>;
template <class _Ty>
_INLINE_VAR constexpr bool _Is_copy_assignable_unchecked_v = is_copy_assignable_v<_Ty>;
#endif // defined(_IS_ASSIGNABLE_NOCHECK_SUPPORTED) && !defined(__CUDACC__)
_EXPORT_STD template <class _Ty>
struct is_move_assignable : bool_constant<__is_assignable(add_lvalue_reference_t<_Ty>, _Ty)> {
// determine whether an rvalue _Ty can be assigned to an lvalue _Ty
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_move_assignable_v = __is_assignable(add_lvalue_reference_t<_Ty>, _Ty);
#if defined(_IS_ASSIGNABLE_NOCHECK_SUPPORTED) && !defined(__CUDACC__)
template <class _Ty>
struct _Is_move_assignable_no_precondition_check
: bool_constant<__is_assignable_no_precondition_check(add_lvalue_reference_t<_Ty>, _Ty)> {};
template <class _Ty>
_INLINE_VAR constexpr bool _Is_move_assignable_unchecked_v =
__is_assignable_no_precondition_check(add_lvalue_reference_t<_Ty>, _Ty);
#else // ^^^ Use intrinsic / intrinsic not supported vvv
template <class _Ty>
using _Is_move_assignable_no_precondition_check = is_move_assignable<_Ty>;
template <class _Ty>
_INLINE_VAR constexpr bool _Is_move_assignable_unchecked_v = is_move_assignable_v<_Ty>;
#endif // defined(_IS_ASSIGNABLE_NOCHECK_SUPPORTED) && !defined(__CUDACC__)
_EXPORT_STD template <class _Ty>
struct is_destructible : bool_constant<__is_destructible(_Ty)> {
// true iff remove_all_extents_t<_Ty> is a reference type, or can be explicitly destroyed
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_destructible_v = __is_destructible(_Ty);
_EXPORT_STD template <class _Ty, class... _Args>
struct is_trivially_constructible : bool_constant<__is_trivially_constructible(_Ty, _Args...)> {
// determine whether direct-initialization of _Ty with _Args... is trivial
};
_EXPORT_STD template <class _Ty, class... _Args>
_INLINE_VAR constexpr bool is_trivially_constructible_v = __is_trivially_constructible(_Ty, _Args...);
_EXPORT_STD template <class _Ty>
struct is_trivially_copy_constructible
: bool_constant<__is_trivially_constructible(_Ty, add_lvalue_reference_t<const _Ty>)> {
// determine whether direct-initialization of _Ty with an lvalue const _Ty is trivial
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_trivially_copy_constructible_v =
__is_trivially_constructible(_Ty, add_lvalue_reference_t<const _Ty>);
_EXPORT_STD template <class _Ty>
struct is_trivially_default_constructible : bool_constant<__is_trivially_constructible(_Ty)> {
// determine whether value-initialization of _Ty is trivial
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_trivially_default_constructible_v = __is_trivially_constructible(_Ty);
_EXPORT_STD template <class _Ty>
struct is_trivially_move_constructible : bool_constant<__is_trivially_constructible(_Ty, _Ty)> {
// determine whether direct-initialization of _Ty with an rvalue _Ty is trivial
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_trivially_move_constructible_v = __is_trivially_constructible(_Ty, _Ty);
_EXPORT_STD template <class _To, class _From>
struct is_trivially_assignable : bool_constant<__is_trivially_assignable(_To, _From)> {
// determine whether _From can be trivially assigned to _To
};
_EXPORT_STD template <class _To, class _From>
_INLINE_VAR constexpr bool is_trivially_assignable_v = __is_trivially_assignable(_To, _From);
_EXPORT_STD template <class _Ty>
struct is_trivially_copy_assignable
: bool_constant<__is_trivially_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t<const _Ty>)> {
// determine whether an lvalue const _Ty can be trivially assigned to an lvalue _Ty
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_trivially_copy_assignable_v =
__is_trivially_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t<const _Ty>);
_EXPORT_STD template <class _Ty>
struct is_trivially_move_assignable : bool_constant<__is_trivially_assignable(add_lvalue_reference_t<_Ty>, _Ty)> {
// determine whether an rvalue _Ty can be trivially assigned to an lvalue _Ty
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_trivially_move_assignable_v = __is_trivially_assignable(add_lvalue_reference_t<_Ty>, _Ty);
_EXPORT_STD template <class _Ty>
struct is_trivially_destructible : bool_constant<__is_trivially_destructible(_Ty)> {
// determine whether remove_all_extents_t<_Ty> is a reference type or can trivially be explicitly destroyed
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_trivially_destructible_v = __is_trivially_destructible(_Ty);
_EXPORT_STD template <class _Ty, class... _Args>
struct is_nothrow_constructible : bool_constant<__is_nothrow_constructible(_Ty, _Args...)> {
// determine whether direct-initialization of _Ty from _Args... is both valid and not potentially-throwing
};
_EXPORT_STD template <class _Ty, class... _Args>
_INLINE_VAR constexpr bool is_nothrow_constructible_v = __is_nothrow_constructible(_Ty, _Args...);
_EXPORT_STD template <class _Ty>
struct is_nothrow_copy_constructible
: bool_constant<__is_nothrow_constructible(_Ty, add_lvalue_reference_t<const _Ty>)> {
// determine whether direct-initialization of _Ty from an lvalue const _Ty is both valid
// and not potentially-throwing
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_nothrow_copy_constructible_v =
__is_nothrow_constructible(_Ty, add_lvalue_reference_t<const _Ty>);
_EXPORT_STD template <class _Ty>
struct is_nothrow_default_constructible : bool_constant<__is_nothrow_constructible(_Ty)> {
// determine whether value-initialization of _Ty is both valid and not potentially-throwing
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_nothrow_default_constructible_v = __is_nothrow_constructible(_Ty);
_EXPORT_STD template <class _Ty>
struct is_nothrow_move_constructible : bool_constant<__is_nothrow_constructible(_Ty, _Ty)> {
// determine whether direct-initialization of _Ty from an rvalue _Ty is both valid and not potentially-throwing
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_nothrow_move_constructible_v = __is_nothrow_constructible(_Ty, _Ty);
_EXPORT_STD template <class _To, class _From>
struct is_nothrow_assignable : bool_constant<__is_nothrow_assignable(_To, _From)> {
// determine whether assignment of _From to _To is both valid and not potentially-throwing
};
_EXPORT_STD template <class _To, class _From>
_INLINE_VAR constexpr bool is_nothrow_assignable_v = __is_nothrow_assignable(_To, _From);
_EXPORT_STD template <class _Ty>
struct is_nothrow_copy_assignable
: bool_constant<__is_nothrow_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t<const _Ty>)> {
// determine whether assignment of an lvalue const _Ty to an lvalue _Ty is both valid and not potentially-throwing
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_nothrow_copy_assignable_v =
__is_nothrow_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t<const _Ty>);
_EXPORT_STD template <class _Ty>
struct is_nothrow_move_assignable : bool_constant<__is_nothrow_assignable(add_lvalue_reference_t<_Ty>, _Ty)> {
// determine whether assignment of an rvalue _Ty to an lvalue _Ty is both valid and not potentially-throwing
};
_EXPORT_STD template <class _Ty>
_INLINE_VAR constexpr bool is_nothrow_move_assignable_v = __is_nothrow_assignable(add_lvalue_reference_t<_Ty>, _Ty);
_EXPORT_STD template <class _Ty>
struct is_nothrow_destructible : bool_constant<__is_nothrow_destructible(_Ty)> {
// determine whether remove_all_extents_t<_Ty> is a reference type or has
// non-potentially-throwing explicit destruction
};