28 #ifndef YB_INC_ystdex_type_op_hpp_
29 #define YB_INC_ystdex_type_op_hpp_ 1
37 using std::tr1::add_reference;
39 using std::tr1::has_nothrow_assign;
40 using std::tr1::has_nothrow_constructor;
41 using std::tr1::has_nothrow_copy;
42 using std::tr1::has_trivial_assign;
43 using std::tr1::has_trivial_constructor;
44 using std::tr1::has_trivial_copy;
45 using std::tr1::has_trivial_destructor;
48 using std::integral_constant;
50 using std::false_type;
53 using std::is_integral;
54 using std::is_floating_point;
56 using std::is_pointer;
57 using std::is_lvalue_reference;
58 using std::is_rvalue_reference;
59 using std::is_member_object_pointer;
60 using std::is_member_function_pointer;
64 using std::is_function;
66 using std::is_reference;
67 using std::is_arithmetic;
68 using std::is_fundamental;
71 using std::is_compound;
72 using std::is_member_pointer;
75 using std::is_volatile;
76 using std::is_trivial;
78 using std::is_standard_layout;
80 using std::is_literal_type;
82 using std::is_polymorphic;
83 using std::is_abstract;
86 using std::is_unsigned;
88 using std::is_constructible;
90 using std::is_default_constructible;
91 using std::is_copy_constructible;
92 using std::is_move_constructible;
94 using std::is_assignable;
95 using std::is_copy_assignable;
96 using std::is_move_assignable;
98 using std::is_destructible;
100 using std::is_trivially_constructible;
101 using std::is_trivially_default_constructible;
102 using std::is_trivially_copy_constructible;
103 using std::is_trivially_move_constructible;
105 using std::is_trivially_assignable;
106 using std::is_trivially_copy_assignable;
107 using std::is_trivially_move_assignable;
108 using std::is_trivially_destructible;
110 using std::is_nothrow_constructible;
111 using std::is_nothrow_default_constructible;
112 using std::is_nothrow_copy_constructible;
113 using std::is_nothrow_move_constructible;
115 using std::is_nothrow_assignable;
116 using std::is_nothrow_copy_assignable;
117 using std::is_nothrow_move_assignable;
119 using std::is_nothrow_destructible;
121 using std::has_virtual_destructor;
123 using std::alignment_of;
128 using std::is_base_of;
129 using std::is_convertible;
131 using std::remove_const;
132 using std::remove_volatile;
133 using std::remove_cv;
134 using std::add_const;
135 using std::add_volatile;
138 using std::remove_reference;
139 using std::add_lvalue_reference;
140 using std::add_rvalue_reference;
142 using std::make_signed;
143 using std::make_unsigned;
145 using std::remove_extent;
146 using std::remove_all_extents;
148 using std::remove_pointer;
149 using std::add_pointer;
151 using std::aligned_storage;
153 using std::enable_if;
154 using std::conditional;
155 using std::common_type;
157 using std::result_of;
212 template<
typename _type>
214 && !is_abstract<_type>::value && !is_function<_type>::value>
223 template<
typename _type>
225 !is_same<typename decay<_type>::type, _type>::value>
234 template<
typename _type>
236 && is_class<typename remove_pointer<_type>::type>::value>
245 template<
typename _type>
247 _type>::value && is_class<typename remove_reference<_type>::type>::value>
257 template<
typename _type>
259 _type>::value && is_class<typename remove_reference<_type>::type>::value>
269 template<
typename _type>
271 is_pod<_type>::value && is_class<_type>::value>
281 template<
typename _type>
283 is_pod<_type>::value && is_union<_type>::value>
290 #ifdef YB_IMPL_GNUCPP
291 # if YB_IMPL_GNUCPP >= 40600
292 # pragma GCC diagnostic push
293 # pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
295 # pragma GCC system_header
310 #define YB_TYPE_OP_TEST_2(_n, _expr) \
311 template<typename _type1, typename _type2> \
315 template<typename _type> \
316 static yconstfn bool \
317 test(int, typename enable_if<(_expr), int>::type = 0) \
322 static yconstfn bool \
329 static yconstexpr bool value = test(); \
339 _type>() == std::declval<_type2>()),
bool>::value))
344 std::declval<_type2>()])>::value)
347 #if YB_IMPL_GNUCPP && YB_IMPL_GNUCPP >= 40600
349 # pragma GCC diagnostic pop
356 template<
class _type>
359 static_assert(std::is_class<_type>::value,
360 "Non-class type found @ ystdex::has_nonempty_virtual_base;");
387 template<
class _type1,
class _type2>
388 struct have_common_nonempty_virtual_base
390 static_assert(std::is_class<_type1>::value
391 && std::is_class<_type2>::value,
392 "Non-class type found @ ystdex::has_common_nonempty_virtual_base;");
395 struct A :
virtual _type1
401 #ifdef YB_IMPL_GNUCPP
402 # if YB_IMPL_GNUCPP >= 40600
403 # pragma GCC diagnostic push
404 # pragma GCC diagnostic ignored "-Wextra"
406 # pragma GCC system_header
410 struct B :
virtual _type2
421 #if YB_IMPL_GNUCPP && YB_IMPL_GNUCPP >= 40600
423 # pragma GCC diagnostic pop
438 template<
typename _type1,
typename _type2>
448 template<
typename _type1,
typename _type2>
449 struct has_equality_operator : integral_constant<bool,
450 details::have_equality_operator<_type1, _type2>::value>
459 template<
class _type>
460 struct has_nonempty_virtual_base : integral_constant<bool,
461 details::have_nonempty_virtual_base<_type>::value>
470 template<
class _type1,
class _type2>
471 struct has_common_nonempty_virtual_base : integral_constant<bool,
472 details::have_common_nonempty_virtual_base<_type1, _type2>::value>
483 template<
typename _type>
496 template<
typename _type>
499 typedef typename remove_cv<typename remove_reference<_type>::type>
::type
510 template<
typename _type>
513 typedef typename remove_pointer<typename remove_reference<_type>
523 template<
typename _type>
526 typedef typename remove_cv<typename remove_rp<_type>::type>
::type type;
538 template<
typename _type>
541 typedef typename conditional<is_array<_type>::value,
542 typename decay<_type>::type, _type>
::type type;
554 template<
typename _type>
555 struct qualified_decay
558 typedef typename remove_reference<_type>::type
value_type;
561 typedef typename conditional<is_function<value_type>::value
562 || is_array<value_type>::value,
typename decay<_type>::type,
576 template<
typename _type>
582 template<
typename _type>
589 template<
typename _type>
593 typedef type&& reference;
603 template<
typename _tInt>
605 :
public integral_constant<size_t, sizeof(_tInt) * CHAR_BIT>
615 template<
typename _type,
bool>
618 typedef typename std::make_signed<_type>::type
type;
621 template<
typename _type>
624 typedef typename std::make_unsigned<_type>::type
type;
636 struct make_fixed_width_int
645 typedef std::int8_t
type;
652 typedef std::int16_t
type;
659 typedef std::int32_t
type;
666 typedef std::int64_t
type;
712 template<
size_t... _vSeq>
727 template<
size_t... _vSeq>