YSTest: type_traits.hpp 源文件

YSTest PreAlpha_b800_20170810 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

type_traits.hpp
浏览该文件的文档.
1 /*
2 © 2011-2016 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
28 #ifndef YB_INC_ystdex_type_traits_hpp_
29 #define YB_INC_ystdex_type_traits_hpp_ 1
30
31 #include "../ydef.h" // for <type_traits>, __cpp_lib_bool_constant,
32 // __cpp_lib_void_t;
33
34 namespace ystdex
35 {
36
96 template<class _type>
97 using _t = typename _type::type;
98
103 inline namespace cpp2011
104 {
105
107
108 using std::integral_constant;
109 using std::true_type;
110 using std::false_type;
111
112 using std::is_void;
113 using std::is_integral;
114 using std::is_floating_point;
115 using std::is_array;
116 using std::is_pointer;
117 using std::is_lvalue_reference;
118 using std::is_rvalue_reference;
119 using std::is_member_object_pointer;
120 using std::is_member_function_pointer;
121 using std::is_enum;
122 using std::is_class;
123 using std::is_union;
124 using std::is_function;
125
126 using std::is_reference;
127 using std::is_arithmetic;
128 using std::is_fundamental;
129 using std::is_object;
130 using std::is_scalar;
131 using std::is_compound;
132 using std::is_member_pointer;
133
134 using std::is_const;
135 using std::is_volatile;
136 using std::is_trivial;
137 // using std::is_trivially_copyable;
138 using std::is_standard_layout;
139 using std::is_pod;
140 using std::is_literal_type;
141 using std::is_empty;
142 using std::is_polymorphic;
143 using std::is_abstract;
144
145 using std::is_signed;
146 using std::is_unsigned;
147
148 using std::is_constructible;
150
151 using std::is_default_constructible;
152 using std::is_copy_constructible;
153 using std::is_move_constructible;
154
155 using std::is_assignable;
156 using std::is_copy_assignable;
157 using std::is_move_assignable;
158
159 using std::is_destructible;
161
163
164 using std::is_trivially_constructible;
165 using std::is_trivially_default_constructible;
166 using std::is_trivially_copy_constructible;
167 using std::is_trivially_move_constructible;
168
169 using std::is_trivially_assignable;
170 using std::is_trivially_copy_assignable;
171 using std::is_trivially_move_assignable;
173 using std::is_trivially_destructible;
175
177
178 using std::is_nothrow_constructible;
179 using std::is_nothrow_default_constructible;
180 using std::is_nothrow_copy_constructible;
181 using std::is_nothrow_move_constructible;
182
183 using std::is_nothrow_assignable;
184 using std::is_nothrow_copy_assignable;
185 using std::is_nothrow_move_assignable;
186
187 using std::is_nothrow_destructible;
189
190 using std::has_virtual_destructor;
191
192 using std::alignment_of;
193 using std::rank;
194 using std::extent;
195
196 using std::is_same;
197 using std::is_base_of;
198 using std::is_convertible;
199
200 using std::remove_const;
201 using std::remove_volatile;
202 using std::remove_cv;
203 using std::add_const;
204 using std::add_volatile;
205 using std::add_cv;
206
207 using std::remove_reference;
208 using std::add_lvalue_reference;
209 using std::add_rvalue_reference;
210
211 using std::make_signed;
212 using std::make_unsigned;
213
214 using std::remove_extent;
215 using std::remove_all_extents;
216
217 using std::remove_pointer;
218 using std::add_pointer;
219
220 using std::aligned_storage;
222 using std::aligned_union;
223 using std::decay;
224 using std::enable_if;
225 using std::conditional;
226 using std::common_type;
228 using std::underlying_type;
229 using std::result_of;
231
232 } // inline namespace cpp2011;
233
234
239 inline namespace cpp2014
240 {
241
247 #if __cpp_lib_transformation_trait_aliases >= 201304 || __cplusplus > 201103L
248 using std::remove_const_t;
249 using std::remove_volatile_t;
250 using std::remove_cv_t;
251 using std::add_const_t;
252 using std::add_volatile_t;
253 using std::add_cv_t;
254
255 using std::remove_reference_t;
256 using std::add_lvalue_reference_t;
257 using std::add_rvalue_reference_t;
258
259 using std::make_signed_t;
260 using std::make_unsigned_t;
261
262 using std::remove_extent_t;
263 using std::remove_all_extents_t;
264
265 using std::remove_pointer_t;
266 using std::add_pointer_t;
267
268 using std::aligned_storage_t;
269 using std::aligned_union_t;
270 using std::decay_t;
271 using std::enable_if_t;
272 using std::conditional_t;
273 using std::common_type_t;
274 using std::underlying_type_t;
275 using std::result_of_t;
276 #else
277
279 template<typename _type>
280 using remove_const_t = typename remove_const<_type>::type;
281
282 template<typename _type>
283 using remove_volatile_t = typename remove_volatile<_type>::type;
284
285 template<typename _type>
286 using remove_cv_t = typename remove_cv<_type>::type;
287
288 template<typename _type>
289 using add_const_t = typename add_const<_type>::type;
290
291 template<typename _type>
292 using add_volatile_t = typename add_volatile<_type>::type;
293
294 template<typename _type>
295 using add_cv_t = typename add_cv<_type>::type;
296
297
298 template<typename _type>
299 using remove_reference_t = typename remove_reference<_type>::type;
300
301 template<typename _type>
302 using add_lvalue_reference_t = typename add_lvalue_reference<_type>::type;
303
304 template<typename _type>
305 using add_rvalue_reference_t = typename add_rvalue_reference<_type>::type;
306
307
308 template<typename _type>
309 using make_signed_t = typename make_signed<_type>::type;
310
311 template<typename _type>
312 using make_unsigned_t = typename make_unsigned<_type>::type;
313
314
315 template<typename _type>
316 using remove_extent_t = typename remove_extent<_type>::type;
317
318 template<typename _type>
319 using remove_all_extents_t = typename remove_all_extents<_type>::type;
320
321
322 template<typename _type>
323 using remove_pointer_t = typename remove_pointer<_type>::type;
324
325 template<typename _type>
326 using add_pointer_t = typename add_pointer<_type>::type;
327
328
329 template<size_t _vLen,
330 size_t _vAlign = yalignof(typename aligned_storage<_vLen>::type)>
331 using aligned_storage_t = typename aligned_storage<_vLen, _vAlign>::type;
333
335
336 template<size_t _vLen, typename... _types>
337 using aligned_union_t = typename aligned_union<_vLen, _types...>::type;
338
339 template<typename _type>
340 using decay_t = typename decay<_type>::type;
341
342 template<bool _bCond, typename _type = void>
343 using enable_if_t = typename enable_if<_bCond, _type>::type;
344
345 template<bool _bCond, typename _type, typename _type2>
346 using conditional_t = typename conditional<_bCond, _type, _type2>::type;
347
348 template<typename... _types>
349 using common_type_t = typename common_type<_types...>::type;
350
351 template<typename _type>
352 using underlying_type_t = typename underlying_type<_type>::type;
353
354 template<typename _type>
355 using result_of_t = typename result_of<_type>::type;
357 #endif
358
359
360 } // inline namespace cpp2014;
361
362
364
365
370 #define YB_Impl_DeclIntT(_n, _t) \
371 template<_t _vInt> \
372 using _n = std::integral_constant<_t, _vInt>;
373 #define YB_Impl_DeclIntTDe(_t) YB_Impl_DeclIntT(_t##_, _t)
374
375 YB_Impl_DeclIntTDe(bool)
376 YB_Impl_DeclIntTDe(char)
377 YB_Impl_DeclIntTDe(int)
378 YB_Impl_DeclIntT(llong_, long long)
379 YB_Impl_DeclIntTDe(long)
380 YB_Impl_DeclIntTDe(short)
381 YB_Impl_DeclIntT(ullong_, unsigned long long)
382 YB_Impl_DeclIntT(ulong_, unsigned long)
383 YB_Impl_DeclIntT(uint_, unsigned)
384 YB_Impl_DeclIntT(ushort_, unsigned short)
385 YB_Impl_DeclIntTDe(size_t)
386 YB_Impl_DeclIntTDe(ptrdiff_t)
387
388 #undef YB_Impl_DeclIntTDe
389 #undef YB_Impl_DeclIntT
390
391 using true_ = bool_<true>;
392 using false_ = bool_<false>;
394
395
402 // TODO: Blocked. Wait for upcoming ISO C++17 for %__cplusplus.
403 #if __cpp_lib_bool_constant >= 201505
404 using std::bool_constant;
405 #else
406 template<bool _b>
407 using bool_constant = bool_<_b>;
408 #endif
409
410
411
419 template<class...>
420 struct and_;
421
422 template<>
423 struct and_<> : true_
424 {};
425
426 template<class _b1>
427 struct and_<_b1> : _b1
428 {};
429
431 template<class _b1, class _b2, class... _bn>
432 struct and_<_b1, _b2, _bn...>
433 : conditional_t<_b1::value, and_<_b2, _bn...>, _b1>
434 {};
435
436
437 template<class...>
438 struct or_;
439
440 template<>
441 struct or_<> : false_
442 {};
443
444 template<class _b1>
445 struct or_<_b1> : _b1
446 {};
447
449 template<class _b1, class _b2, class... _bn>
450 struct or_<_b1, _b2, _bn...>
451 : conditional_t<_b1::value, _b1, or_<_b2, _bn...>>
452 {};
453
454
455 template<class _b>
456 struct not_ : bool_<!_b::value>
457 {};
459
460
461 namespace details
462 {
463
464 template<typename _type>
465 struct is_referenceable_function : false_
466 {};
467
468 template<typename _tRes, typename... _tParams>
469 struct is_referenceable_function<_tRes(_tParams...)> : true_
470 {};
471
472 template<typename _tRes, typename... _tParams>
473 struct is_referenceable_function<_tRes(_tParams..., ...)> : true_
474 {};
475
476 } // namespace details;
477
484 template<typename _type>
485 struct is_referenceable : or_<is_object<_type>, is_reference<_type>,
486 details::is_referenceable_function<_type>>
487 {};
488
489
491 struct any_constructible;
493 struct nonesuch;
494
495
500 namespace dep_swap
501 {
502
503 using std::swap;
504
506 nonesuch
507 swap(any_constructible, any_constructible);
508
509 template<typename _type, typename _type2>
510 struct yimpl(helper)
511 {
512 static yconstexpr const bool value = !is_same<decltype(swap(std::declval<
513 _type>(), std::declval<_type2>())), nonesuch>::value;
514
516 helper()
517 ynoexcept_spec(swap(std::declval<_type>(), std::declval<_type2>()))
518 {}
519 };
520
521 } // namespace dep_swap;
522
523
530
532 template<typename _type, typename _type2>
534 struct is_swappable_with : bool_<yimpl(dep_swap::helper<_type, _type2>::value)>
535 {};
536
537
539 template<typename _type>
540 struct is_swappable
541 : and_<is_referenceable<_type>, is_swappable_with<_type&, _type&>>
542 {};
544
545
547
548 template<typename _type, typename _type2>
549 struct is_nothrow_swappable_with
550 : is_nothrow_default_constructible<yimpl(dep_swap::helper<_type, _type2>)>
551 {};
552
553
554 template<typename _type>
555 struct is_nothrow_swappable
556 : and_<is_referenceable<_type>, is_nothrow_swappable_with<_type&, _type&>>
557 {};
559
560
561
563
564
566 template<typename _type>
568 struct always
569 {
570 private:
571 template<typename...>
572 struct impl
573 {
574 using type = _type;
575 };
576
577 public:
578 template<typename... _types>
579 using apply = impl<_types...>;
580 };
581
588 #if YB_IMPL_GNUCPP
589 template<typename _type, typename...>
590 using well_formed_t = _type;
591 #else
592 template<typename _type, typename... _types>
593 using well_formed_t = typename always<_type>::template apply<_types...>::type;
594 #endif
595
601 // TODO: Blocked. Wait for upcoming ISO C++17 for %__cplusplus.
602 #if __cpp_lib_void_t >= 201411
603 using std::void_t;
604 #else
605 template<typename... _types>
606 using void_t = well_formed_t<void, _types...>;
607 #endif
608
615 template<bool _bCond>
616 struct when;
617
623 template<typename... _types>
624 using when_valid = well_formed_t<when<true>, _types...>;
625
632 template<bool _bCond>
633 using enable_when = enable_if_t<_bCond, when<true>>;
635
636
643 template<class... _b>
644 using conjunction = and_<_b...>;
645
646 template<class... _b>
647 using disjunction = or_<_b...>;
648
649 template<class _b>
650 using negation = not_<_b>;
652
653
658 struct any_constructible
659 {
660 any_constructible(...);
661 };
662
663
669 struct nonesuch
670 {
671 nonesuch() = delete;
672 nonesuch(const nonesuch&) = delete;
673 ~nonesuch() = delete;
674
675 void
676 operator=(const nonesuch&) = delete;
677 };
678
679
686 namespace details
687 {
688
689 template<typename _tDefault, typename, template<typename...> class, typename...>
690 struct detector
691 {
692 using value_t = false_;
693 using type = _tDefault;
694 };
695
696 template<typename _tDefault, template<typename...> class _gOp,
697 typename... _tParams>
698 struct detector<_tDefault, void_t<_gOp<_tParams...>>, _gOp, _tParams...>
699 {
700 using value_t = true_;
701 using type = _gOp<_tParams...>;
702 };
703
704 } // namespace details;
705
706 template<template<typename...> class _gOp, typename... _tParams>
707 using is_detected
708 = typename details::detector<nonesuch, void, _gOp, _tParams...>::value_t;
709
710 template<template<typename...> class _gOp, typename... _tParams>
711 using detected_t = _t<details::detector<nonesuch, void, _gOp, _tParams...>>;
712
713 template<typename _tDefault, template<typename...> class _gOp,
714 typename... _tParams>
715 using detected_or = details::detector<_tDefault, void, _gOp, _tParams...>;
716
717 template<typename _tDefault, template<typename...> class _gOp,
718 typename... _tParams>
719 using detected_or_t = _t<detected_or<_tDefault, _gOp, _tParams...>>;
720
721 template<typename _tExpected, template<typename...> class _gOp,
722 typename... _tParams>
723 using is_detected_exact = is_same<_tExpected, detected_t<_gOp, _tParams...>>;
724
725 template<typename _tTo, template<typename...> class _gOp, typename... _tParams>
726 using is_detected_convertible
727 = is_convertible<detected_t<_gOp, _tParams...>, _tTo>;
729
731
732
737 template<typename _tCond, typename _tThen = true_, typename _tElse = false_>
738 using cond_t = conditional_t<_tCond::value, _tThen, _tElse>;
739
746 template<class _tClass, typename _tParam, typename _type = void>
747 using exclude_self_t
748 = enable_if_t<!is_same<_tClass&, decay_t<_tParam>&>::value, _type>;
750
751
757
759
763 template<typename _type>
764 struct is_array_of_unknown_bound
765 : bool_<is_array<_type>::value && extent<_type>::value == 0>
766 {};
767
768
773 template<typename _type>
774 struct is_object_or_void : or_<is_object<_type>, is_void<_type>>
775 {};
776
777
784 template<typename _type>
785 struct is_returnable
786 : not_<or_<is_array<_type>, is_abstract<_type>, is_function<_type>>>
787 {};
788
789
794 template<typename _type>
795 struct is_class_type
796 : or_<is_class<_type>, is_union<_type>>
797 {};
798
799
804 template<typename _type>
805 struct is_nonconst_object
806 : and_<is_object<_type>, is_same<add_const_t<_type>, _type>>
807 {};
808
809
811
812 template<typename _type>
814 struct is_pointer_to_object
815 : and_<is_pointer<_type>, is_object<remove_pointer_t<_type>>>
816 {};
817
818
820 template<typename _type>
821 struct is_object_pointer
822 : and_<is_pointer<_type>, is_object_or_void<remove_pointer_t<_type>>>
823 {};
824
825
827 template<typename _type>
828 struct is_function_pointer
829 : and_<is_pointer<_type>, is_function<remove_pointer_t<_type>>>
830 {};
832
833
835
836 template<typename _type>
838 struct is_class_pointer
839 : and_<is_pointer<_type>, is_class<remove_pointer_t<_type>>>
840 {};
841
842
844 template<typename _type>
845 struct is_lvalue_class_reference
846 : and_<is_lvalue_reference<_type>, is_class<remove_reference_t<_type>>>
847 {};
848
849
851 template<typename _type>
852 struct is_rvalue_class_reference
853 : and_<is_rvalue_reference<_type>, is_class<remove_reference_t<_type>>>
854 {};
855
856
862 template<typename _type>
864 struct is_pod_struct : and_<is_pod<_type>, is_class<_type>>
865 {};
866
867
869 template<typename _type>
870 struct is_pod_union : and_<is_pod<_type>, is_union<_type>>
871 {};
873
874
875
876
881 template<typename _type>
882 struct is_cv : or_<is_const<_type>, is_volatile<_type>>
883 {};
884
885
891 template<typename>
892 struct is_decomposable : false_
893 {};
894
895 template<template<typename...> class _gOp, typename... _types>
896 struct is_decomposable<_gOp<_types...>> : true_
897 {};
899
900
905 template<typename _type>
906 struct is_decayed : or_<is_same<decay_t<_type>, _type>>
907 {};
908
909
916 template<typename _type>
917 struct is_copyable
918 : and_<is_copy_constructible<_type>, is_copy_assignable<_type>>
919 {};
920
921
922 template<typename _type>
923 struct is_moveable
924 : and_<is_move_constructible<_type>, is_move_assignable<_type>>
925 {};
926
927
928 template<typename _type>
929 struct is_nothrow_copyable : and_<is_nothrow_copy_constructible<_type>,
930 is_nothrow_copy_assignable<_type>>
931 {};
932
933
934 template<typename _type>
935 struct is_nothrow_moveable : and_<is_nothrow_move_constructible<_type>,
936 is_nothrow_move_assignable<_type>>
937 {};
938
939
940 template<typename _type>
941 struct is_trivially_copyable : and_<is_trivially_copy_constructible<_type>,
942 is_trivially_copy_assignable<_type>>
943 {};
944
945
946 template<typename _type>
947 struct is_trivially_moveable : and_<is_trivially_move_constructible<_type>,
948 is_trivially_move_assignable<_type>>
949 {};
951
952
953
959 template<typename _type1, typename _type2>
960 struct is_interoperable
961 : or_<is_convertible<_type1, _type2>, is_convertible<_type2, _type1>>
962 {};
963
964
970 template<typename _type, typename... _types>
972 struct are_same : and_<is_same<_type, _types>...>
973 {};
974
976 template<typename _type, typename... _types>
977 struct is_in_types : or_<is_same<_type, _types...>>
978 {};
980
981
983
984
998 template<typename _type>
999 struct identity
1000 {
1001 using type = _type;
1002 };
1003
1005 template<typename _type>
1006 using identity_t = _t<identity<_type>>;
1008
1009
1017 template<typename _type>
1018 using id_t = _type;
1019
1020 template<typename _type>
1021 using add_ptr_t = _type*;
1022
1023 template<typename _type>
1024 using add_ref_t = _type&;
1025
1026 template<typename _type>
1027 using add_rref_t = _type&&;
1029
1030
1032
1033 template<typename _type>
1034 using addrof_t = decltype(&std::declval<_type>());
1035
1036 template<typename _type>
1037 using indirect_t = decltype(*std::declval<_type>());
1039
1041 template<typename _type>
1042 using indirect_element_t = remove_reference_t<indirect_t<_type>>;
1043
1044
1050 template<typename _tFrom, typename _tTo, typename _type = void>
1051 using enable_if_convertible_t
1052 = enable_if_t<is_convertible<_tFrom, _tTo>::value, _type>;
1053
1055 template<typename _tFrom, typename _tTo, typename _type = void>
1056 using enable_if_inconvertible_t
1057 = enable_if_t<!is_convertible<_tFrom, _tTo>::value, _type>;
1058
1059 template<typename _type1, typename _type2, typename _type = void>
1060 using enable_if_interoperable_t
1061 = enable_if_t<is_interoperable<_type1, _type2>::value, _type>;
1062
1064 template<typename _type1, typename _type2, typename _type = void>
1065 using enable_if_same_t
1066 = enable_if_t<is_same<_type1, _type2>::value, _type>;
1068
1069
1070
1071 } // namespace ystdex;
1072
1073 #endif
1074
ystdex::add_ref_t
_type & add_ref_t
Definition: type_traits.hpp:1024
ystdex::cpp2014::make_unsigned_t
typename make_unsigned< _type >::type make_unsigned_t
Definition: type_traits.hpp:312
ystdex::cpp2014::result_of_t
typename result_of< _type >::type result_of_t
Definition: type_traits.hpp:355
ystdex::cond_t
conditional_t< _tCond::value, _tThen, _tElse > cond_t
条件判断。
Definition: type_traits.hpp:738
ystdex::true_
bool_< true > true_
Definition: type_traits.hpp:391
ystdex::and_<>
Definition: type_traits.hpp:423
ystdex::cpp2014::remove_volatile_t
typename remove_volatile< _type >::type remove_volatile_t
Definition: type_traits.hpp:283
ystdex::always
表达式 SFINAE 别名模板。
Definition: type_traits.hpp:568
ystdex::cpp2014::remove_pointer_t
typename remove_pointer< _type >::type remove_pointer_t
Definition: type_traits.hpp:323
YB_Impl_DeclIntT
#define YB_Impl_DeclIntT(_n, _t)
整数常量类型别名。
Definition: type_traits.hpp:370
ystdex::ushort_
std::integral_constant< unsigned short, _vInt > ushort_
Definition: type_traits.hpp:384
ystdex::details::detector< _tDefault, void_t< _gOp< _tParams... > >, _gOp, _tParams... >::value_t
true_ value_t
Definition: type_traits.hpp:700
ystdex::addrof_t
decltype(&std::declval< _type >()) addrof_t
Definition: type_traits.hpp:1034
ystdex::enable_if_same_t
enable_if_t< is_same< _type1, _type2 >::value, _type > enable_if_same_t
Definition: type_traits.hpp:1066
yalignof
#define yalignof(_type)
指定特定类型的对齐。
Definition: ydef.h:660
ystdex::cpp2014::remove_cv_t
typename remove_cv< _type >::type remove_cv_t
Definition: type_traits.hpp:286
ystdex::or_<>
Definition: type_traits.hpp:441
ystdex::is_detected_exact
is_same< _tExpected, detected_t< _gOp, _tParams... >> is_detected_exact
Definition: type_traits.hpp:723
ystdex::indirect_t
decltype(*std::declval< _type >()) indirect_t
Definition: type_traits.hpp:1037
ystdex::false_
bool_< false > false_
Definition: type_traits.hpp:392
ystdex::details::detector< _tDefault, void_t< _gOp< _tParams... > >, _gOp, _tParams... >::type
_gOp< _tParams... > type
Definition: type_traits.hpp:701
ystdex::enable_if_interoperable_t
enable_if_t< is_interoperable< _type1, _type2 >::value, _type > enable_if_interoperable_t
Definition: type_traits.hpp:1061
ystdex::identity
恒等元函数。
Definition: type_traits.hpp:999
ystdex::not_
Definition: type_traits.hpp:456
ystdex::or_
Definition: type_traits.hpp:438
ynoexcept_spec
#define ynoexcept_spec(...)
表达式 noexcept 异常规范。
Definition: ydef.h:794
ystdex::add_ptr_t
_type * add_ptr_t
Definition: type_traits.hpp:1021
ystdex::is_object_or_void
判断指定类型是否为对象或 void 类型。
Definition: type_traits.hpp:774
ystdex::is_interoperable
判断指定类型之间是否可转换。
Definition: type_traits.hpp:960
ystdex::is_class_type
判断指定类型是否是类类型。
Definition: type_traits.hpp:795
ystdex::is_nothrow_moveable
Definition: type_traits.hpp:935
ystdex::is_in_types
判断第一个参数在之后参数指定的类型中出现。
Definition: type_traits.hpp:977
ystdex::is_cv
判断指定类型是否为 const 或 volatile 类型。
Definition: type_traits.hpp:882
ystdex::cpp2014::enable_if_t
typename enable_if< _bCond, _type >::type enable_if_t
Definition: type_traits.hpp:343
ystdex::enable_if_inconvertible_t
enable_if_t<!is_convertible< _tFrom, _tTo >::value, _type > enable_if_inconvertible_t
Definition: type_traits.hpp:1057
ystdex::ulong_
std::integral_constant< unsigned long, _vInt > ulong_
Definition: type_traits.hpp:382
yconstexpr
#define yconstexpr
指定编译时常量表达式。
Definition: ydef.h:679
ystdex::void_t
well_formed_t< void, _types... > void_t
Definition: type_traits.hpp:606
ystdex::nonesuch
不接受任意参数类型构造的类型。
Definition: type_traits.hpp:669
ystdex::cpp2014::add_volatile_t
typename add_volatile< _type >::type add_volatile_t
Definition: type_traits.hpp:292
ystdex::cpp2014::remove_extent_t
typename remove_extent< _type >::type remove_extent_t
Definition: type_traits.hpp:316
ystdex::cpp2014::add_cv_t
typename add_cv< _type >::type add_cv_t
Definition: type_traits.hpp:295
ystdex::cpp2014::aligned_storage_t
typename aligned_storage< _vLen, _vAlign >::type aligned_storage_t
Definition: type_traits.hpp:331
ystdex::detected_or_t
_t< detected_or< _tDefault, _gOp, _tParams... >> detected_or_t
Definition: type_traits.hpp:719
ystdex::details::detector::type
_tDefault type
Definition: type_traits.hpp:693
ystdex::and_< _b1 >
Definition: type_traits.hpp:427
ystdex::identity_t
_t< identity< _type >> identity_t
Definition: type_traits.hpp:1006
ystdex::details::detector::value_t
false_ value_t
Definition: type_traits.hpp:692
ystdex::uint_
std::integral_constant< unsigned, _vInt > uint_
Definition: type_traits.hpp:383
ystdex::indirect_element_t
remove_reference_t< indirect_t< _type >> indirect_element_t
Definition: type_traits.hpp:1042
ystdex::cpp2014::decay_t
typename decay< _type >::type decay_t
Definition: type_traits.hpp:340
ystdex::llong_
std::integral_constant< long long, _vInt > llong_
Definition: type_traits.hpp:378
ystdex
特性测试宏。
Definition: ydef.h:822
ystdex::cpp2014::add_pointer_t
typename add_pointer< _type >::type add_pointer_t
Definition: type_traits.hpp:326
ystdex::well_formed_t
typename always< _type >::template apply< _types... >::type well_formed_t
void_t 的一般化，允许指定别名类型。
Definition: type_traits.hpp:593
ystdex::or_< _b1 >
Definition: type_traits.hpp:445
ystdex::_t
typename _type::type _t
嵌套类型别名。
Definition: type_traits.hpp:97
YB_Impl_DeclIntTDe
#define YB_Impl_DeclIntTDe(_t)
Definition: type_traits.hpp:373
ystdex::is_referenceable
判断指定类型是否为可引用类型。
Definition: type_traits.hpp:485
ystdex::is_nothrow_swappable
Definition: type_traits.hpp:555
ystdex::is_decayed
判断指定类型是否已退化。
Definition: type_traits.hpp:906
ystdex::id_t
_type id_t
Definition: type_traits.hpp:1018
ystdex::add_rref_t
_type && add_rref_t
Definition: type_traits.hpp:1027
ystdex::exclude_self_t
enable_if_t<!is_same< _tClass &, decay_t< _tParam > & >::value, _type > exclude_self_t
移除选择类类型的特定重载避免构造模板和复制/转移特殊成员函数冲突。
Definition: type_traits.hpp:748
ystdex::when
类似 void_t 的元函数，具有较低匹配优先级，避免偏特化歧义；但使用条件表达式。
Definition: type_traits.hpp:616
ystdex::cpp2014::remove_reference_t
typename remove_reference< _type >::type remove_reference_t
Definition: type_traits.hpp:299
ystdex::always::impl
Definition: type_traits.hpp:572
std
Definition: memory.hpp:1183
ystdex::is_nonconst_object
判断类型是否为非 const 对象类型。
Definition: type_traits.hpp:805
ystdex::details::detector
Definition: type_traits.hpp:690
ystdex::is_rvalue_class_reference
判断指定类型是否是类类型右值引用。
Definition: type_traits.hpp:852
ystdex::is_pod_union
判断指定类型是否是 POD union 。
Definition: type_traits.hpp:870
ystdex::is_class_pointer
判断指定类型是否是指向类类型的指针。
Definition: type_traits.hpp:838
ystdex::is_trivially_copyable
Definition: type_traits.hpp:941
ystdex::identity::type
_type type
Definition: type_traits.hpp:1001
ystdex::cpp2014::common_type_t
typename common_type< _types... >::type common_type_t
Definition: type_traits.hpp:349
ystdex::is_nothrow_copyable
Definition: type_traits.hpp:929
ystdex::is_detected_convertible
is_convertible< detected_t< _gOp, _tParams... >, _tTo > is_detected_convertible
Definition: type_traits.hpp:727
ystdex::when_valid
well_formed_t< when< true >, _types... > when_valid
类似 void_t 的元函数，但具有较低匹配优先级，避免偏特化歧义。
Definition: type_traits.hpp:624
ystdex::cpp2014::remove_const_t
typename remove_const< _type >::type remove_const_t
ISO C++ 14 兼容类型操作别名。
Definition: type_traits.hpp:280
ystdex::dep_swap::swap
nonesuch swap(any_constructible, any_constructible)
ystdex::cpp2014::add_const_t
typename add_const< _type >::type add_const_t
Definition: type_traits.hpp:289
ystdex::is_object_pointer
判断指定类型是否是指向对象类型的指针。
Definition: type_traits.hpp:821
ystdex::detected_t
_t< details::detector< nonesuch, void, _gOp, _tParams... >> detected_t
Definition: type_traits.hpp:711
ystdex::is_lvalue_class_reference
判断指定类型是否是类类型左值引用。
Definition: type_traits.hpp:845
ystdex::enable_when
enable_if_t< _bCond, when< true >> enable_when
类似 enable_if_t 的元函数，但具有较低匹配优先级，避免偏特化歧义。
Definition: type_traits.hpp:633
ystdex::dep_swap::helper::helper
helper()
Definition: type_traits.hpp:516
ystdex::are_same
判断第一个参数和之后的参数指定的类型相同。
Definition: type_traits.hpp:972
ystdex::is_swappable
Definition: type_traits.hpp:540
ystdex::enable_if_convertible_t
enable_if_t< is_convertible< _tFrom, _tTo >::value, _type > enable_if_convertible_t
Definition: type_traits.hpp:1052
ystdex::is_detected
typename details::detector< nonesuch, void, _gOp, _tParams... >::value_t is_detected
Definition: type_traits.hpp:708
ystdex::bool_constant
bool_< _b > bool_constant
bool 常量。
Definition: type_traits.hpp:407
ystdex::is_pointer_to_object
判断指定类型是否是指向对象类型的指针。
Definition: type_traits.hpp:814
ystdex::is_function_pointer
判断指定类型是否是指向函数类型的指针。
Definition: type_traits.hpp:828
ystdex::is_trivially_moveable
Definition: type_traits.hpp:947
ystdex::cpp2014::conditional_t
typename conditional< _bCond, _type, _type2 >::type conditional_t
Definition: type_traits.hpp:346
ystdex::any_constructible
接受任意参数类型构造的类型。
Definition: type_traits.hpp:658
ystdex::is_array_of_unknown_bound
判断是否为未知大小的数组类型。
Definition: type_traits.hpp:764
ystdex::is_nothrow_swappable_with
判断是否可以无抛出地调用 swap 。
Definition: type_traits.hpp:549
ystdex::is_decomposable
判断指定类型是否可分解为一个参数为类型的模板和类型参数。
Definition: type_traits.hpp:892
ystdex::apply
auto apply(_func &&f, _tTuple &&args) -> decltype(call_projection< _tTuple, make_index_sequence< std::tuple_size< decay_t< _tTuple >>::value >>::call(std::forward< decltype(f)>(f), std::forward< decltype(args)>(args)))
应用函数对象和参数元组。
Definition: functional.hpp:1098
ystdex::cpp2014::make_signed_t
typename make_signed< _type >::type make_signed_t
Definition: type_traits.hpp:309
ystdex::details::is_referenceable_function
Definition: type_traits.hpp:465
ystdex::ullong_
std::integral_constant< unsigned long long, _vInt > ullong_
Definition: type_traits.hpp:381
ystdex::and_
逻辑操作元函数。
Definition: type_traits.hpp:420
ystdex::cpp2014::remove_all_extents_t
typename remove_all_extents< _type >::type remove_all_extents_t
Definition: type_traits.hpp:319
ystdex::is_pod_struct
判断指定类型是否是 POD struct 。
Definition: type_traits.hpp:864
ystdex::is_moveable
Definition: type_traits.hpp:923
ystdex::cpp2014::underlying_type_t
typename underlying_type< _type >::type underlying_type_t
Definition: type_traits.hpp:352
ystdex::is_copyable
Definition: type_traits.hpp:917
ystdex::is_returnable
判断指定类型是否可作为返回类型。
Definition: type_traits.hpp:785
ystdex::is_swappable_with
判断是否可以调用 swap 。
Definition: type_traits.hpp:534
ystdex::cpp2014::add_lvalue_reference_t
typename add_lvalue_reference< _type >::type add_lvalue_reference_t
Definition: type_traits.hpp:302
ystdex::always::impl::type
_type type
Definition: type_traits.hpp:574
ystdex::cpp2014::aligned_union_t
typename aligned_union< _vLen, _types... >::type aligned_union_t
Definition: type_traits.hpp:337
ystdex::bool_
std::integral_constant< bool, _vInt > bool_
Definition: type_traits.hpp:375
ystdex::cpp2014::add_rvalue_reference_t
typename add_rvalue_reference< _type >::type add_rvalue_reference_t
Definition: type_traits.hpp:305