18 #ifndef _MINLIB_TYPE_TRAITS_H_
19 #define _MINLIB_TYPE_TRAITS_H_
99 template <
typename T,
size_t N>
102 typedef T array_type[N];
112 template <
typename T,
size_t N>
115 typedef const T array_type[N];
167 template<
typename T,
typename... Args>
170 template<
typename T,
typename... Args>
173 template<
typename T,
typename... Args>
176 template<
typename T,
typename... Args>
179 template<
typename T,
typename... Args>
182 template<
typename T,
typename... Args>
185 template<
typename T,
typename... Args>
188 template<
typename T,
typename... Args>
191 template<
typename T,
typename... Args>
194 template<
typename T,
typename... Args>
197 template<
typename T,
typename... Args>
200 template<
typename T,
typename... Args>
203 template<
typename T,
typename... Args>
206 template<
typename T,
typename... Args>
209 template<
typename T,
typename... Args>
212 template<
typename T,
typename... Args>
215 template<
typename T,
typename... Args>
218 template<
typename T,
typename... Args>
221 template<
typename T,
typename... Args>
224 template<
typename T,
typename... Args>
227 template<
typename T,
typename... Args>
230 template<
typename T,
typename... Args>
233 template<
typename T,
typename... Args>
236 template<
typename T,
typename... Args>
323 template <
typename T>
326 template <
typename T>
329 template <
typename T>
357 :
public integral_constant<bool, is_integral<T>::value || is_rational<T>::value> { };
361 :
public integral_constant<bool, is_fundamental<T>::value | is_pointer<T>::value | is_pod<T>::value> { };
365 :
public integral_constant<bool, is_fundamental<T>::value | is_pointer<T>::value | is_pod<T>::value> { };
369 :
public integral_constant<bool, is_fundamental<T>::value | is_pointer<T>::value | is_pod<T>::value> { };
373 :
public integral_constant<bool, is_fundamental<T>::value || is_pointer<T>::value || is_pod<T>::value> { };
377 :
public integral_constant<bool, is_lvalue_reference<T>::value | is_rvalue_reference<T>::value> { };
382 :
public integral_constant< bool, !(is_integral<T>::value | is_floating_point<T>::value) > { };
387 :
public integral_constant< bool, ! (is_function<T>::value | is_reference<T>::value |
388 is_void<T>::value) > { };
391 template <
typename T>
398 struct is_signed<signed char> : true_type {};
401 struct is_signed<short> : true_type {};
404 struct is_signed<int> : true_type {};
407 struct is_signed<long> : true_type {};
410 struct is_signed<long long> : true_type {};
413 struct is_signed<float> : true_type {};
416 struct is_signed<double> : true_type {};
419 struct is_signed<long double> : true_type {};
421 template <typename T>
422 struct is_signed<const T> : is_signed<T> {};
424 template <typename T>
425 struct is_signed<volatile T> : is_signed<T> {};
427 template <typename T>
428 struct is_signed<const volatile T> : is_signed<T> {};
432 template <typename T>
433 struct is_unsigned : false_type {};
436 struct is_unsigned<bool> : true_type {};
439 struct is_unsigned<char> : integral_constant<bool, (char(255) > 0)> {};
456 template <
typename T>
459 template <
typename T>
462 template <
typename T>
477 struct has_cheap_compare :
public integral_constant<bool, has_trivial_copy<T>::value && sizeof(T) <= 4 > { };
480 template<size_t size, size_t align = alignof(void *)>
481 struct aligned_storage {
482 struct type { alignas(align) unsigned char data[size]; };
485 template<size_t size, size_t align = alignof(void *)>
486 using aligned_storage_t = typename aligned_storage<size, align>::type;
490 #define MN_INTEGRAL(T) template<> \
491 struct is_integral<T> : public integral_constant<bool, true> { };
493 #define MN_RATIONAL(T) template<> \
494 struct is_rational<T> : public integral_constant<bool, true> { };
496 #define MN_VOIDTYPE(T) template<> \
497 struct is_void<T> : public integral_constant<bool, true> { };
500 MN_INTEGRAL(unsigned char);
502 MN_INTEGRAL(unsigned short);
504 MN_INTEGRAL(unsigned int);
506 MN_INTEGRAL(unsigned long);
507 MN_INTEGRAL(wchar_t);
511 MN_VOIDTYPE(const void);
512 MN_VOIDTYPE(volatile void );
513 MN_VOIDTYPE(const volatile void );
517 MN_RATIONAL(long double);
struct mn::memory::detail::ptr_difference T
Definition: mn_atomic_singleton.hpp:38
Definition: mn_allocator_typetraits.hpp:25
const T *& const_reference
Definition: mn_typetraits.hpp:94
T value_type
Definition: mn_typetraits.hpp:51
const T * const_pointer
Definition: mn_typetraits.hpp:96
const T & const_reference
Definition: mn_typetraits.hpp:34
T & reference
Definition: mn_typetraits.hpp:63
T * pointer
Definition: mn_typetraits.hpp:35
T & reference
Definition: mn_typetraits.hpp:73
const T * const_type
Definition: mn_typetraits.hpp:92
T * pointer
Definition: mn_typetraits.hpp:75
T value_type
Definition: mn_typetraits.hpp:71
T & reference
Definition: mn_typetraits.hpp:43
const T * const_pointer
Definition: mn_typetraits.hpp:86
const T * const_pointer
Definition: mn_typetraits.hpp:56
const T * const_pointer
Definition: mn_typetraits.hpp:76
const T & const_reference
Definition: mn_typetraits.hpp:44
T * pointer
Definition: mn_typetraits.hpp:65
const T * const_pointer
Definition: mn_typetraits.hpp:36
const T & const_reference
Definition: mn_typetraits.hpp:64
T value_type
Definition: mn_typetraits.hpp:61
const T const_type
Definition: mn_typetraits.hpp:82
T & reference
Definition: mn_typetraits.hpp:83
T * pointer
Definition: mn_typetraits.hpp:85
T value_type
Definition: mn_typetraits.hpp:41
T * pointer
Definition: mn_typetraits.hpp:45
const T * const_pointer
Definition: mn_typetraits.hpp:66
T *& reference
Definition: mn_typetraits.hpp:93
const T const_type
Definition: mn_typetraits.hpp:32
const T const_type
Definition: mn_typetraits.hpp:62
T value_type
Definition: mn_typetraits.hpp:81
T * pointer
Definition: mn_typetraits.hpp:95
T * pointer
Definition: mn_typetraits.hpp:55
T value_type
Definition: mn_typetraits.hpp:31
const T const_type
Definition: mn_typetraits.hpp:42
T * value_type
Definition: mn_typetraits.hpp:91
const T const_type
Definition: mn_typetraits.hpp:72
T & reference
Definition: mn_typetraits.hpp:53
const T & const_reference
Definition: mn_typetraits.hpp:84
const T & const_reference
Definition: mn_typetraits.hpp:54
const T const_type
Definition: mn_typetraits.hpp:52
T & reference
Definition: mn_typetraits.hpp:33
const T * const_pointer
Definition: mn_typetraits.hpp:46
const T & const_reference
Definition: mn_typetraits.hpp:74
Definition: mn_typetraits.hpp:466
Definition: mn_typetraits.hpp:30
Definition: mn_typetraits.hpp:369
Definition: mn_typetraits.hpp:361
Definition: mn_typetraits.hpp:365
Definition: mn_typetraits.hpp:373
Definition: mn_typetraits.hpp:125
@ value
Definition: mn_typetraits.hpp:126
Definition: mn_typetraits.hpp:240
is_arithmetic
Definition: mn_typetraits.hpp:382
Definition: mn_typetraits.hpp:264
Definition: mn_typetraits.hpp:159
is_compound
Definition: mn_typetraits.hpp:473
Definition: mn_typetraits.hpp:133
is_empty
Definition: mn_typetraits.hpp:149
Definition: mn_typetraits.hpp:153
Definition: mn_typetraits.hpp:312
Definition: mn_typetraits.hpp:165
Definition: mn_typetraits.hpp:357
Definition: mn_typetraits.hpp:274
Definition: mn_typetraits.hpp:246
is_lvalue_reference
Definition: mn_typetraits.hpp:334
is_object
Definition: mn_typetraits.hpp:388
Definition: mn_typetraits.hpp:267
Definition: mn_typetraits.hpp:249
Definition: mn_typetraits.hpp:349
Definition: mn_typetraits.hpp:243
Definition: mn_typetraits.hpp:288
Definition: mn_typetraits.hpp:377
is_rvalue_reference
Definition: mn_typetraits.hpp:342
is_signed
Definition: mn_typetraits.hpp:392
is_standard_layout
Definition: mn_typetraits.hpp:261
is_trivial
Definition: mn_typetraits.hpp:253
Definition: mn_typetraits.hpp:257
Definition: mn_typetraits.hpp:156
is_unsigned
Definition: mn_typetraits.hpp:433
Definition: mn_typetraits.hpp:300
is_volatile
Definition: mn_typetraits.hpp:140
array_type & reference
Definition: mn_typetraits.hpp:106
T * pointer
Definition: mn_typetraits.hpp:108
const T * const_pointer
Definition: mn_typetraits.hpp:109
const T * const_type
Definition: mn_typetraits.hpp:105
T * value_type
Definition: mn_typetraits.hpp:104
const array_type & const_reference
Definition: mn_typetraits.hpp:107
array_type & reference
Definition: mn_typetraits.hpp:119
T * pointer
Definition: mn_typetraits.hpp:121
const T * const_pointer
Definition: mn_typetraits.hpp:122
const T * value_type
Definition: mn_typetraits.hpp:117
const T * const_type
Definition: mn_typetraits.hpp:118
const array_type & const_reference
Definition: mn_typetraits.hpp:120