YSTest: type_traits.hpp 源文件

YSTest PreAlpha_b700_20160611 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
95 template<class _type>
96 using _t = typename _type::type;
97
102 inline namespace cpp2011
103 {
104
106
107 using std::integral_constant;
108 using std::true_type;
109 using std::false_type;
110
111 using std::is_void;
112 using std::is_integral;
113 using std::is_floating_point;
114 using std::is_array;
115 using std::is_pointer;
116 using std::is_lvalue_reference;
117 using std::is_rvalue_reference;
118 using std::is_member_object_pointer;
119 using std::is_member_function_pointer;
120 using std::is_enum;
121 using std::is_class;
122 using std::is_union;
123 using std::is_function;
124
125 using std::is_reference;
126 using std::is_arithmetic;
127 using std::is_fundamental;
128 using std::is_object;
129 using std::is_scalar;
130 using std::is_compound;
131 using std::is_member_pointer;
132
133 using std::is_const;
134 using std::is_volatile;
135 using std::is_trivial;
136 // using std::is_trivially_copyable;
137 using std::is_standard_layout;
138 using std::is_pod;
139 using std::is_literal_type;
140 using std::is_empty;
141 using std::is_polymorphic;
142 using std::is_abstract;
143
144 using std::is_signed;
145 using std::is_unsigned;
146
147 using std::is_constructible;
149
150 using std::is_default_constructible;
151 using std::is_copy_constructible;
152 using std::is_move_constructible;
153
154 using std::is_assignable;
155 using std::is_copy_assignable;
156 using std::is_move_assignable;
157
158 using std::is_destructible;
160
161 # if !YB_IMPL_GNUC || YB_IMPL_GNUCPP >= 50000
162
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 # endif
174 using std::is_trivially_destructible;
176
178
179 using std::is_nothrow_constructible;
180 using std::is_nothrow_default_constructible;
181 using std::is_nothrow_copy_constructible;
182 using std::is_nothrow_move_constructible;
183
184 using std::is_nothrow_assignable;
185 using std::is_nothrow_copy_assignable;
186 using std::is_nothrow_move_assignable;
187
188 using std::is_nothrow_destructible;
190
191 using std::has_virtual_destructor;
192
193 using std::alignment_of;
194 using std::rank;
195 using std::extent;
196
197 using std::is_same;
198 using std::is_base_of;
199 using std::is_convertible;
200
201 using std::remove_const;
202 using std::remove_volatile;
203 using std::remove_cv;
204 using std::add_const;
205 using std::add_volatile;
206 using std::add_cv;
207
208 using std::remove_reference;
209 using std::add_lvalue_reference;
210 using std::add_rvalue_reference;
211
212 using std::make_signed;
213 using std::make_unsigned;
214
215 using std::remove_extent;
216 using std::remove_all_extents;
217
218 using std::remove_pointer;
219 using std::add_pointer;
220
221 using std::aligned_storage;
222 # if !YB_IMPL_GNUC || YB_IMPL_GNUCPP >= 50000
223 using std::aligned_union;
225 # endif
226 using std::decay;
227 using std::enable_if;
228 using std::conditional;
229 using std::common_type;
231 using std::underlying_type;
232 using std::result_of;
234
235 } // inline namespace cpp2011;
236
237
242 inline namespace cpp2014
243 {
244
250 #if __cpp_lib_transformation_trait_aliases >= 201304 || __cplusplus > 201103L
251 using std::remove_const_t;
252 using std::remove_volatile_t;
253 using std::remove_cv_t;
254 using std::add_const_t;
255 using std::add_volatile_t;
256 using std::add_cv_t;
257
258 using std::remove_reference_t;
259 using std::add_lvalue_reference_t;
260 using std::add_rvalue_reference_t;
261
262 using std::make_signed_t;
263 using std::make_unsigned_t;
264
265 using std::remove_extent_t;
266 using std::remove_all_extents_t;
267
268 using std::remove_pointer_t;
269 using std::add_pointer_t;
270
271 using std::aligned_storage_t;
272 # if !YB_IMPL_GNUC || YB_IMPL_GNUCPP >= 50000
273 using std::aligned_union_t;
274 # endif
275 using std::decay_t;
276 using std::enable_if_t;
277 using std::conditional_t;
278 using std::common_type_t;
279 using std::underlying_type_t;
280 using std::result_of_t;
281 #else
282
284 template<typename _type>
285 using remove_const_t = typename remove_const<_type>::type;
286
287 template<typename _type>
288 using remove_volatile_t = typename remove_volatile<_type>::type;
289
290 template<typename _type>
291 using remove_cv_t = typename remove_cv<_type>::type;
292
293 template<typename _type>
294 using add_const_t = typename add_const<_type>::type;
295
296 template<typename _type>
297 using add_volatile_t = typename add_volatile<_type>::type;
298
299 template<typename _type>
300 using add_cv_t = typename add_cv<_type>::type;
301
302
303 template<typename _type>
304 using remove_reference_t = typename remove_reference<_type>::type;
305
306 template<typename _type>
307 using add_lvalue_reference_t = typename add_lvalue_reference<_type>::type;
308
309 template<typename _type>
310 using add_rvalue_reference_t = typename add_rvalue_reference<_type>::type;
311
312
313 template<typename _type>
314 using make_signed_t = typename make_signed<_type>::type;
315
316 template<typename _type>
317 using make_unsigned_t = typename make_unsigned<_type>::type;
318
319
320 template<typename _type>
321 using remove_extent_t = typename remove_extent<_type>::type;
322
323 template<typename _type>
324 using remove_all_extents_t = typename remove_all_extents<_type>::type;
325
326
327 template<typename _type>
328 using remove_pointer_t = typename remove_pointer<_type>::type;
329
330 template<typename _type>
331 using add_pointer_t = typename add_pointer<_type>::type;
332
333
334 template<size_t _vLen,
335 size_t _vAlign = yalignof(typename aligned_storage<_vLen>::type)>
336 using aligned_storage_t = typename aligned_storage<_vLen, _vAlign>::type;
338
340
341 # if !YB_IMPL_GNUC || YB_IMPL_GNUCPP >= 50000
342 template<size_t _vLen, typename... _types>
343 using aligned_union_t = typename aligned_union<_vLen, _types...>::type;
344 # endif
345
346 template<typename _type>
347 using decay_t = typename decay<_type>::type;
348
349 template<bool _bCond, typename _type = void>
350 using enable_if_t = typename enable_if<_bCond, _type>::type;
351
352 template<bool _bCond, typename _type, typename _type2>
353 using conditional_t = typename conditional<_bCond, _type, _type2>::type;
354
355 template<typename... _types>
356 using common_type_t = typename common_type<_types...>::type;
357
358 template<typename _type>
359 using underlying_type_t = typename underlying_type<_type>::type;
360
361 template<typename _type>
362 using result_of_t = typename result_of<_type>::type;
364 #endif
365
366
367 } // inline namespace cpp2014;
368
369
377 // TODO: Blocked. Wait for upcoming ISO C++17 for %__cplusplus.
378 #if __cpp_lib_bool_constant >= 201505
379 using std::bool_constant;
380 #else
381 template<bool _b>
382 using bool_constant = integral_constant<bool, _b>;
383 #endif
384
385
393 template<typename...>
394 struct and_;
395
396 template<>
397 struct and_<> : true_type
398 {};
399
400 template<typename _b1>
401 struct and_<_b1> : _b1
402 {};
403
405 template<typename _b1, typename _b2, typename... _bn>
406 struct and_<_b1, _b2, _bn...>
407 : conditional_t<_b1::value, and_<_b2, _bn...>, _b1>
408 {};
409
410
411 template<typename...>
412 struct or_;
413
414 template<>
415 struct or_<> : false_type
416 {};
417
418 template<typename _b1>
419 struct or_<_b1> : _b1
420 {};
421
423 template<typename _b1, typename _b2, typename... _bn>
424 struct or_<_b1, _b2, _bn...>
425 : conditional_t<_b1::value, _b1, or_<_b2, _bn...>>
426 {};
427
428
429 template<typename _b>
430 struct not_ : bool_constant<!_b::value>
431 {};
433
434
435 namespace details
436 {
437
438 template<typename _type>
439 struct is_referenceable_function : false_type
440 {};
441
442 template<typename _tRes, typename... _tParams>
443 struct is_referenceable_function<_tRes(_tParams...)> : true_type
444 {};
445
446 template<typename _tRes, typename... _tParams>
447 struct is_referenceable_function<_tRes(_tParams..., ...)> : true_type
448 {};
449
450 } // namespace details;
451
458 template<typename _type>
459 struct is_referenceable : or_<is_object<_type>, is_reference<_type>,
460 details::is_referenceable_function<_type>>
461 {};
462
463
465 struct any_constructible;
467 struct nonesuch;
468
469
474 namespace dep_swap
475 {
476
477 using std::swap;
478
480 nonesuch
481 swap(any_constructible, any_constructible);
482
483 template<typename _type, typename _type2>
484 struct yimpl(helper)
485 {
486 static yconstexpr const bool value = !is_same<decltype(swap(std::declval<
487 _type>(), std::declval<_type2>())), nonesuch>::value;
488
490 helper()
491 ynoexcept_spec(swap(std::declval<_type>(), std::declval<_type2>()))
492 {}
493 };
494
495 } // namespace dep_swap;
496
497
504
506 template<typename _type, typename _type2>
508 struct is_swappable_with
509 : bool_constant<yimpl(dep_swap::helper<_type, _type2>::value)>
510 {};
511
512
514 template<typename _type>
515 struct is_swappable
516 : and_<is_referenceable<_type>, is_swappable_with<_type&, _type&>>
517 {};
519
520
522
523 template<typename _type, typename _type2>
524 struct is_nothrow_swappable_with
525 : is_nothrow_default_constructible<yimpl(dep_swap::helper<_type, _type2>)>
526 {};
527
528
529 template<typename _type>
530 struct is_nothrow_swappable
531 : and_<is_referenceable<_type>, is_nothrow_swappable_with<_type&, _type&>>
532 {};
534
535
536
538
539
541 template<typename _type>
543 struct always
544 {
545 private:
546 template<typename...>
547 struct impl
548 {
549 using type = _type;
550 };
551
552 public:
553 template<typename... _types>
554 using apply = impl<_types...>;
555 };
556
563 #if YB_IMPL_GNUCPP >= 50000
564 template<typename _type, typename...>
565 using well_formed_t = _type;
566 #else
567 template<typename _type, typename... _types>
568 using well_formed_t = typename always<_type>::template apply<_types...>::type;
569 #endif
570
576 // TODO: Blocked. Wait for upcoming ISO C++17 for %__cplusplus.
577 #if __cpp_lib_void_t >= 201411
578 using std::void_t;
579 #else
580 template<typename... _types>
581 using void_t = well_formed_t<void, _types...>;
582 #endif
583
590 template<bool _bCond>
591 struct when;
592
598 template<typename... _types>
599 using when_valid = well_formed_t<when<true>, _types...>;
600
607 template<bool _bCond>
608 using enable_when = enable_if_t<_bCond, when<true>>;
610
611
612
617 struct any_constructible
618 {
619 any_constructible(...);
620 };
621
622
628 struct nonesuch
629 {
630 nonesuch() = delete;
631 nonesuch(const nonesuch&) = delete;
632 ~nonesuch() = delete;
633
634 void
635 operator=(const nonesuch&) = delete;
636 };
637
638
645 namespace details
646 {
647
648 template<typename _tDefault, typename, template<typename...> class, typename...>
649 struct detector
650 {
651 using value_t = false_type;
652 using type = _tDefault;
653 };
654
655 template<typename _tDefault, template<typename...> class _gOp,
656 typename... _tParams>
657 struct detector<_tDefault, void_t<_gOp<_tParams...>>, _gOp, _tParams...>
658 {
659 using value_t = true_type;
660 using type = _gOp<_tParams...>;
661 };
662
663 } // namespace details;
664
665 template<template<typename...> class _gOp, typename... _tParams>
666 using is_detected
667 = typename details::detector<nonesuch, void, _gOp, _tParams...>::value_t;
668
669 template<template<typename...> class _gOp, typename... _tParams>
670 using detected_t = _t<details::detector<nonesuch, void, _gOp, _tParams...>>;
671
672 template<typename _tDefault, template<typename...> class _gOp,
673 typename... _tParams>
674 using detected_or = details::detector<_tDefault, void, _gOp, _tParams...>;
675
676 template<typename _tDefault, template<typename...> class _gOp,
677 typename... _tParams>
678 using detected_or_t = _t<detected_or<_tDefault, _gOp, _tParams...>>;
679
680 template<typename _tExpected, template<typename...> class _gOp,
681 typename... _tParams>
682 using is_detected_exact = is_same<_tExpected, detected_t<_gOp, _tParams...>>;
683
684 template<typename _tTo, template<typename...> class _gOp, typename... _tParams>
685 using is_detected_convertible
686 = is_convertible<detected_t<_gOp, _tParams...>, _tTo>;
688
690
691
696 template<typename _tCond, typename _tThen = true_type,
697 typename _tElse = false_type>
698 using cond_t = conditional_t<_tCond::value, _tThen, _tElse>;
699
706 template<class _tClass, typename _tParam, typename _type = void>
707 using exclude_self_t
708 = enable_if_t<!is_same<_tClass&, decay_t<_tParam>&>::value, _type>;
710
711
717
719
723 template<typename _type>
724 struct is_array_of_unknown_bound
725 : bool_constant<is_array<_type>::value && extent<_type>::value == 0>
726 {};
727
728
733 template<typename _type>
734 struct is_object_or_void : or_<is_object<_type>, is_void<_type>>
735 {};
736
737
744 template<typename _type>
745 struct is_returnable
746 : not_<or_<is_array<_type>, is_abstract<_type>, is_function<_type>>>
747 {};
748
749
754 template<typename _type>
755 struct is_class_type
756 : or_<is_class<_type>, is_union<_type>>
757 {};
758
759
764 template<typename _type>
765 struct is_nonconst_object
766 : and_<is_object<_type>, is_same<add_const_t<_type>, _type>>
767 {};
768
769
771
772 template<typename _type>
774 struct is_pointer_to_object
775 : and_<is_pointer<_type>, is_object<remove_pointer_t<_type>>>
776 {};
777
778
780 template<typename _type>
781 struct is_object_pointer
782 : and_<is_pointer<_type>, is_object_or_void<remove_pointer_t<_type>>>
783 {};
784
785
787 template<typename _type>
788 struct is_function_pointer
789 : and_<is_pointer<_type>, is_function<remove_pointer_t<_type>>>
790 {};
792
793
795
796 template<typename _type>
798 struct is_class_pointer
799 : and_<is_pointer<_type>, is_class<remove_pointer_t<_type>>>
800 {};
801
802
804 template<typename _type>
805 struct is_lvalue_class_reference
806 : and_<is_lvalue_reference<_type>, is_class<remove_reference_t<_type>>>
807 {};
808
809
811 template<typename _type>
812 struct is_rvalue_class_reference
813 : and_<is_rvalue_reference<_type>, is_class<remove_reference_t<_type>>>
814 {};
815
816
822 template<typename _type>
824 struct is_pod_struct : and_<is_pod<_type>, is_class<_type>>
825 {};
826
827
829 template<typename _type>
830 struct is_pod_union : and_<is_pod<_type>, is_union<_type>>
831 {};
833
834
835
836
841 template<typename _type>
842 struct is_cv : or_<is_const<_type>, is_volatile<_type>>
843 {};
844
845
851 template<typename>
852 struct is_decomposable : false_type
853 {};
854
855 template<template<typename...> class _gOp, typename... _types>
856 struct is_decomposable<_gOp<_types...>> : true_type
857 {};
859
860
865 template<typename _type>
866 struct is_decayed : or_<is_same<decay_t<_type>, _type>>
867 {};
868
869
876 template<typename _type>
877 struct is_copyable
878 : and_<is_copy_constructible<_type>, is_copy_assignable<_type>>
879 {};
880
881
882 template<typename _type>
883 struct is_moveable
884 : and_<is_move_constructible<_type>, is_move_assignable<_type>>
885 {};
886
887
888 template<typename _type>
889 struct is_nothrow_copyable : and_<is_nothrow_copy_constructible<_type>,
890 is_nothrow_copy_assignable<_type>>
891 {};
892
893
894 template<typename _type>
895 struct is_nothrow_moveable : and_<is_nothrow_move_constructible<_type>,
896 is_nothrow_move_assignable<_type>>
897 {};
898
899
900 # if !YB_IMPL_GNUC || YB_IMPL_GNUCPP >= 50000
901 template<typename _type>
902 struct is_trivially_copyable : and_<is_trivially_copy_constructible<_type>,
903 is_trivially_copy_assignable<_type>>
904 {};
905
906
907 template<typename _type>
908 struct is_trivially_moveable : and_<is_trivially_move_constructible<_type>,
909 is_trivially_move_assignable<_type>>
910 {};
911 # endif
912
913
914
915
921 template<typename _type1, typename _type2>
922 struct is_interoperable
923 : or_<is_convertible<_type1, _type2>, is_convertible<_type2, _type1>>
924 {};
925
926
932 template<typename _type, typename... _types>
934 struct are_same : and_<is_same<_type, _types>...>
935 {};
936
938 template<typename _type, typename... _types>
939 struct is_in_types : or_<is_same<_type, _types...>>
940 {};
942
943
945
946
960 template<typename _type>
961 struct identity
962 {
963 using type = _type;
964 };
965
967 template<typename _type>
968 using identity_t = _t<identity<_type>>;
970
971
973
974 template<typename _type>
975 using addrof_t = decltype(&std::declval<_type>());
976
977 template<typename _type>
978 using indirect_t = decltype(*std::declval<_type>());
980
982 template<typename _type>
983 using indirect_element_t = remove_reference_t<indirect_t<_type>>;
984
985
991 template<typename _tFrom, typename _tTo, typename _type = void>
992 using enable_if_convertible_t
993 = enable_if_t<is_convertible<_tFrom, _tTo>::value, _type>;
994
996 template<typename _tFrom, typename _tTo, typename _type = void>
997 using enable_if_inconvertible_t
998 = enable_if_t<!is_convertible<_tFrom, _tTo>::value, _type>;
999
1000 template<typename _type1, typename _type2, typename _type = void>
1001 using enable_if_interoperable_t
1002 = enable_if_t<is_interoperable<_type1, _type2>::value, _type>;
1003
1005 template<typename _type1, typename _type2, typename _type = void>
1006 using enable_if_same_t
1007 = enable_if_t<is_same<_type1, _type2>::value, _type>;
1009
1010
1011
1012 } // namespace ystdex;
1013
1014 #endif
1015
ystdex::cpp2014::conditional_t
typename conditional< _bCond, _type, _type2 >::type conditional_t
Definition: type_traits.hpp:353
ystdex::dep_swap::swap
nonesuch swap(any_constructible, any_constructible)
ystdex::when
类似 void_t 的元函数，具有较低匹配优先级，避免偏特化歧义；但使用条件表达式。
Definition: type_traits.hpp:591
yconstexpr
#define yconstexpr
指定编译时常量表达式。
Definition: ydef.h:653
ystdex::details::detector
Definition: type_traits.hpp:649
ystdex::and_<>
Definition: type_traits.hpp:397
ystdex::enable_if_convertible_t
enable_if_t< is_convertible< _tFrom, _tTo >::value, _type > enable_if_convertible_t
Definition: type_traits.hpp:993
ystdex::cpp2014::remove_pointer_t
typename remove_pointer< _type >::type remove_pointer_t
Definition: type_traits.hpp:328
ystdex::always
表达式 SFINAE 别名模板。
Definition: type_traits.hpp:543
ystdex::cpp2014::remove_extent_t
typename remove_extent< _type >::type remove_extent_t
Definition: type_traits.hpp:321
ystdex::is_detected
typename details::detector< nonesuch, void, _gOp, _tParams... >::value_t is_detected
Definition: type_traits.hpp:667
ystdex::detected_t
_t< details::detector< nonesuch, void, _gOp, _tParams... >> detected_t
Definition: type_traits.hpp:670
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:969
ystdex::cpp2014::enable_if_t
typename enable_if< _bCond, _type >::type enable_if_t
Definition: type_traits.hpp:350
ystdex::details::detector< _tDefault, void_t< _gOp< _tParams... > >, _gOp, _tParams... >::value_t
true_type value_t
Definition: type_traits.hpp:659
ystdex::identity
恒等元函数。
Definition: type_traits.hpp:961
ystdex::indirect_t
decltype(*std::declval< _type >()) indirect_t
Definition: type_traits.hpp:978
ystdex::or_< _b1 >
Definition: type_traits.hpp:419
ystdex::identity_t
_t< identity< _type >> identity_t
Definition: type_traits.hpp:968
ystdex::enable_if_inconvertible_t
enable_if_t<!is_convertible< _tFrom, _tTo >::value, _type > enable_if_inconvertible_t
Definition: type_traits.hpp:998
ystdex::enable_if_same_t
enable_if_t< is_same< _type1, _type2 >::value, _type > enable_if_same_t
Definition: type_traits.hpp:1007
ystdex::cpp2014::remove_reference_t
typename remove_reference< _type >::type remove_reference_t
Definition: type_traits.hpp:304
ystdex::is_rvalue_class_reference
判断指定类型是否是类类型右值引用。
Definition: type_traits.hpp:812
ystdex::is_pod_union
判断指定类型是否是 POD union 。
Definition: type_traits.hpp:830
ystdex::is_nonconst_object
判断类型是否为非 const 对象类型。
Definition: type_traits.hpp:765
ystdex::details::detector::type
_tDefault type
Definition: type_traits.hpp:652
ystdex::is_interoperable
判断指定类型之间是否可转换。
Definition: type_traits.hpp:922
ystdex::is_trivially_copyable
Definition: type_traits.hpp:902
ystdex::is_object_or_void
判断指定类型是否为对象或 void 类型。
Definition: type_traits.hpp:734
ystdex::bool_constant
integral_constant< bool, _b > bool_constant
bool 常量。
Definition: type_traits.hpp:382
ystdex::cpp2014::remove_const_t
typename remove_const< _type >::type remove_const_t
ISO C++ 14 兼容类型操作别名。
Definition: type_traits.hpp:285
ystdex::nonesuch
不接受任意参数类型构造的类型。
Definition: type_traits.hpp:628
ystdex::enable_if_interoperable_t
enable_if_t< is_interoperable< _type1, _type2 >::value, _type > enable_if_interoperable_t
Definition: type_traits.hpp:1002
ystdex::identity::type
_type type
Definition: type_traits.hpp:963
ystdex::well_formed_t
typename always< _type >::template apply< _types... >::type well_formed_t
void_t 的一般化，允许指定别名类型。
Definition: type_traits.hpp:568
ystdex::exclude_self_t
enable_if_t<!is_same< _tClass &, decay_t< _tParam > & >::value, _type > exclude_self_t
移除选择类类型的特定重载避免构造模板和复制/转移特殊成员函数冲突。
Definition: type_traits.hpp:708
ystdex::is_decayed
判断指定类型是否已退化。
Definition: type_traits.hpp:866
ystdex::cpp2014::remove_all_extents_t
typename remove_all_extents< _type >::type remove_all_extents_t
Definition: type_traits.hpp:324
ystdex::is_swappable
Definition: type_traits.hpp:515
ystdex::is_referenceable
判断指定类型是否为可引用类型。
Definition: type_traits.hpp:459
ystdex::is_nothrow_swappable
Definition: type_traits.hpp:530
ystdex::cpp2014::add_pointer_t
typename add_pointer< _type >::type add_pointer_t
Definition: type_traits.hpp:331
ynoexcept_spec
#define ynoexcept_spec(...)
表达式 noexcept 异常规范。
Definition: ydef.h:768
ystdex::cpp2014::make_signed_t
typename make_signed< _type >::type make_signed_t
Definition: type_traits.hpp:314
ystdex::cpp2014::remove_cv_t
typename remove_cv< _type >::type remove_cv_t
Definition: type_traits.hpp:291
ystdex::dep_swap::helper::helper
helper()
Definition: type_traits.hpp:490
ystdex::and_< _b1 >
Definition: type_traits.hpp:401
ystdex::is_detected_exact
is_same< _tExpected, detected_t< _gOp, _tParams... >> is_detected_exact
Definition: type_traits.hpp:682
ystdex::cpp2014::add_const_t
typename add_const< _type >::type add_const_t
Definition: type_traits.hpp:294
ystdex::cpp2014::add_lvalue_reference_t
typename add_lvalue_reference< _type >::type add_lvalue_reference_t
Definition: type_traits.hpp:307
std
Definition: memory.hpp:1100
ystdex::_t
typename _type::type _t
嵌套类型别名。
Definition: type_traits.hpp:96
ystdex::detected_or_t
_t< detected_or< _tDefault, _gOp, _tParams... >> detected_or_t
Definition: type_traits.hpp:678
ystdex::always::impl
Definition: type_traits.hpp:547
ystdex::cpp2014::add_volatile_t
typename add_volatile< _type >::type add_volatile_t
Definition: type_traits.hpp:297
ystdex::void_t
well_formed_t< void, _types... > void_t
Definition: type_traits.hpp:581
ystdex
特性测试宏。
Definition: ydef.h:796
ystdex::cpp2014::decay_t
typename decay< _type >::type decay_t
Definition: type_traits.hpp:347
ystdex::cond_t
conditional_t< _tCond::value, _tThen, _tElse > cond_t
条件判断。
Definition: type_traits.hpp:698
ystdex::is_lvalue_class_reference
判断指定类型是否是类类型左值引用。
Definition: type_traits.hpp:805
ystdex::is_trivially_moveable
Definition: type_traits.hpp:908
ystdex::is_object_pointer
判断指定类型是否是指向对象类型的指针。
Definition: type_traits.hpp:781
ystdex::indirect_element_t
remove_reference_t< indirect_t< _type >> indirect_element_t
Definition: type_traits.hpp:983
ystdex::when_valid
well_formed_t< when< true >, _types... > when_valid
类似 void_t 的元函数，但具有较低匹配优先级，避免偏特化歧义。
Definition: type_traits.hpp:599
ystdex::cpp2014::add_rvalue_reference_t
typename add_rvalue_reference< _type >::type add_rvalue_reference_t
Definition: type_traits.hpp:310
ystdex::is_class_pointer
判断指定类型是否是指向类类型的指针。
Definition: type_traits.hpp:798
ystdex::is_nothrow_copyable
Definition: type_traits.hpp:889
ystdex::enable_when
enable_if_t< _bCond, when< true >> enable_when
类似 enable_if_t 的元函数，但具有较低匹配优先级，避免偏特化歧义。
Definition: type_traits.hpp:608
ystdex::is_decomposable
判断指定类型是否可分解为一个参数为类型的模板和类型参数。
Definition: type_traits.hpp:852
ystdex::is_array_of_unknown_bound
判断是否为未知大小的数组类型。
Definition: type_traits.hpp:724
ystdex::is_swappable_with
判断是否可以调用 swap 。
Definition: type_traits.hpp:508
ystdex::details::is_referenceable_function
Definition: type_traits.hpp:439
ystdex::is_nothrow_swappable_with
判断是否可以无抛出地调用 swap 。
Definition: type_traits.hpp:524
ystdex::cpp2014::make_unsigned_t
typename make_unsigned< _type >::type make_unsigned_t
Definition: type_traits.hpp:317
ystdex::always::impl::type
_type type
Definition: type_traits.hpp:549
ystdex::is_detected_convertible
is_convertible< detected_t< _gOp, _tParams... >, _tTo > is_detected_convertible
Definition: type_traits.hpp:686
ystdex::cpp2014::common_type_t
typename common_type< _types... >::type common_type_t
Definition: type_traits.hpp:356
ystdex::cpp2014::remove_volatile_t
typename remove_volatile< _type >::type remove_volatile_t
Definition: type_traits.hpp:288
ystdex::is_function_pointer
判断指定类型是否是指向函数类型的指针。
Definition: type_traits.hpp:788
ystdex::is_pointer_to_object
判断指定类型是否是指向对象类型的指针。
Definition: type_traits.hpp:774
ystdex::are_same
判断第一个参数和之后的参数指定的类型相同。
Definition: type_traits.hpp:934
ystdex::cpp2014::underlying_type_t
typename underlying_type< _type >::type underlying_type_t
Definition: type_traits.hpp:359
ystdex::is_in_types
判断第一个参数在之后参数指定的类型中出现。
Definition: type_traits.hpp:939
ystdex::is_cv
判断指定类型是否为 const 或 volatile 类型。
Definition: type_traits.hpp:842
ystdex::is_class_type
判断指定类型是否是类类型。
Definition: type_traits.hpp:755
ystdex::details::detector::value_t
false_type value_t
Definition: type_traits.hpp:651
ystdex::is_nothrow_moveable
Definition: type_traits.hpp:895
ystdex::or_
Definition: type_traits.hpp:412
ystdex::cpp2014::aligned_storage_t
typename aligned_storage< _vLen, _vAlign >::type aligned_storage_t
Definition: type_traits.hpp:336
ystdex::details::detector< _tDefault, void_t< _gOp< _tParams... > >, _gOp, _tParams... >::type
_gOp< _tParams... > type
Definition: type_traits.hpp:660
ystdex::or_<>
Definition: type_traits.hpp:415
ystdex::any_constructible
接受任意参数类型构造的类型。
Definition: type_traits.hpp:617
ystdex::is_copyable
Definition: type_traits.hpp:877
ystdex::is_returnable
判断指定类型是否可作为返回类型。
Definition: type_traits.hpp:745
ystdex::is_pod_struct
判断指定类型是否是 POD struct 。
Definition: type_traits.hpp:824
ystdex::cpp2014::add_cv_t
typename add_cv< _type >::type add_cv_t
Definition: type_traits.hpp:300
ystdex::is_moveable
Definition: type_traits.hpp:883
ystdex::and_
逻辑操作元函数。
Definition: type_traits.hpp:394
ystdex::cpp2014::result_of_t
typename result_of< _type >::type result_of_t
Definition: type_traits.hpp:362
ystdex::not_
Definition: type_traits.hpp:430
ystdex::addrof_t
decltype(&std::declval< _type >()) addrof_t
Definition: type_traits.hpp:975
yalignof
#define yalignof(_type)
指定特定类型的对齐。
Definition: ydef.h:634
ystdex::cpp2014::aligned_union_t
typename aligned_union< _vLen, _types... >::type aligned_union_t
Definition: type_traits.hpp:343