36#error THIS HEADER IS A GENERATOR. DO NOT INCLUDE.
65#ifndef ETL_TYPE_TRAITS_INCLUDED
66#define ETL_TYPE_TRAITS_INCLUDED
70#include "static_assert.h"
80#if ETL_USING_STL && ETL_USING_CPP11
81 #include <type_traits>
87 template <
typename...>
91#if ETL_NOT_USING_STL || ETL_CPP11_NOT_SUPPORTED
99 template <
typename T, T VALUE>
100 struct integral_constant
102 static const T value = VALUE;
104 typedef T value_type;
105 typedef integral_constant<T, VALUE> type;
107 operator value_type()
const
114 typedef integral_constant<bool, false>
false_type;
115 typedef integral_constant<bool, true> true_type;
117 template <
typename T, T VALUE>
118 const T integral_constant<T, VALUE>::value;
121 template <
typename T, T VALUE>
127 using bool_constant = integral_constant<bool, B>;
135 inline constexpr bool bool_constant_v = bool_constant<B>::value;
140 template <
typename T>
146 template <
typename T>
147 inline constexpr bool negation_v = negation<T>::value;
152 template <
typename T>
struct remove_reference {
typedef T type; };
153 template <
typename T>
struct remove_reference<T&> {
typedef T type; };
155 template <
typename T>
struct remove_reference<T&&> {
typedef T type; };
159 template <
typename T>
160 using remove_reference_t =
typename remove_reference<T>::type;
165 template <
typename T>
struct remove_pointer {
typedef T type; };
166 template <
typename T>
struct remove_pointer<T*> {
typedef T type; };
167 template <
typename T>
struct remove_pointer<const T*> {
typedef const T type; };
168 template <
typename T>
struct remove_pointer<volatile T*> {
typedef volatile T type; };
169 template <
typename T>
struct remove_pointer<const volatile T*> {
typedef const volatile T type; };
170 template <
typename T>
struct remove_pointer<T*
const> {
typedef T type; };
171 template <
typename T>
struct remove_pointer<const T*
const> {
typedef const T type; };
172 template <
typename T>
struct remove_pointer<volatile T*
const> {
typedef volatile T type; };
173 template <
typename T>
struct remove_pointer<const volatile T*
const> {
typedef const volatile T type; };
176 template <
typename T>
177 using remove_pointer_t =
typename remove_pointer<T>::type;
182 template <
typename T>
struct add_pointer {
typedef typename remove_reference<T>::type* type; };
185 template <
typename T>
186 using add_pointer_t =
typename add_pointer<T>::type;
191 template <
typename T>
struct is_const :
false_type {};
192 template <
typename T>
struct is_const<const T> : true_type {};
193 template <
typename T>
struct is_const<const volatile T> : true_type {};
196 template <
typename T>
197 inline constexpr bool is_const_v = is_const<T>::value;
202 template <
typename T>
struct remove_const {
typedef T type; };
203 template <
typename T>
struct remove_const<const T> {
typedef T type; };
206 template <
typename T>
207 using remove_const_t =
typename remove_const<T>::type;
212 template <
typename T>
struct add_const {
typedef const T type; };
213 template <
typename T>
struct add_const<const T> {
typedef const T type; };
216 template <
typename T>
217 using add_const_t =
typename add_const<T>::type;
222 template <
typename T>
struct is_volatile :
false_type {};
223 template <
typename T>
struct is_volatile<volatile T> : true_type {};
224 template <
typename T>
struct is_volatile<const volatile T> : true_type {};
227 template <
typename T>
228 inline constexpr bool is_volatile_v = is_volatile<T>::value;
233 template <
typename T>
struct remove_volatile {
typedef T type; };
234 template <
typename T>
struct remove_volatile<volatile T> {
typedef T type; };
237 template <
typename T>
238 using remove_volatile_t =
typename remove_volatile<T>::type;
243 template <
typename T>
struct add_volatile {
typedef volatile T type; };
244 template <
typename T>
struct add_volatile<volatile T> {
typedef volatile T type; };
247 template <
typename T>
248 using add_volatile_t =
typename add_volatile<T>::type;
253 template <
typename T>
struct remove_cv
255 typedef typename remove_volatile<typename remove_const<T>::type>::type type;
259 template <
typename T>
260 using remove_cv_t =
typename remove_cv<T>::type;
265 template <
typename T>
struct add_cv
267 typedef typename add_volatile<typename add_const<T>::type>::type type;
271 template <
typename T>
272 using add_cv_t =
typename add_cv<T>::type;
277 template <
typename T>
struct remove_cvref
279 typedef typename remove_cv<typename remove_reference<T>::type>::type type;
283 template <
typename T>
284 using remove_cvref_t =
typename remove_cvref<T>::type;
289 template <
typename T>
struct is_integral :
false_type {};
290 template <>
struct is_integral<bool> : true_type {};
291 template <>
struct is_integral<char> : true_type {};
292 template <>
struct is_integral<unsigned char> : true_type {};
293 template <>
struct is_integral<signed char> : true_type {};
294 template <>
struct is_integral<wchar_t> : true_type {};
295 template <>
struct is_integral<short> : true_type {};
296 template <>
struct is_integral<unsigned short> : true_type {};
297 template <>
struct is_integral<int> : true_type {};
298 template <>
struct is_integral<unsigned int> : true_type {};
299 template <>
struct is_integral<long> : true_type {};
300 template <>
struct is_integral<unsigned long> : true_type {};
301 template <>
struct is_integral<long long> : true_type {};
302 template <>
struct is_integral<unsigned long long> : true_type {};
303 template <
typename T>
struct is_integral<const T> : is_integral<T> {};
304 template <
typename T>
struct is_integral<volatile T> : is_integral<T> {};
305 template <
typename T>
struct is_integral<const volatile T> : is_integral<T> {};
308 template <
typename T>
309 inline constexpr bool is_integral_v = is_integral<T>::value;
314 template <
typename T>
struct is_signed :
false_type {};
316 template <> struct is_signed<wchar_t> : public etl::bool_constant<wchar_t(-1) < wchar_t(0)> {};
317 template <> struct is_signed<signed char> : true_type {};
318 template <> struct is_signed<short> : true_type {};
319 template <> struct is_signed<int> : true_type {};
320 template <> struct is_signed<long> : true_type {};
321 template <> struct is_signed<long long> : true_type {};
322 template <> struct is_signed<float> : true_type {};
323 template <> struct is_signed<double> : true_type {};
324 template <> struct is_signed<long double> : true_type {};
325 template <typename T> struct is_signed<const T> : is_signed<T> {};
326 template <typename T> struct is_signed<volatile T> : is_signed<T> {};
327 template <typename T> struct is_signed<const volatile T> : is_signed<T> {};
330 template <typename T>
331 inline constexpr bool is_signed_v = is_signed<T>::value;
336 template <typename T> struct is_unsigned : false_type {};
337 template <> struct is_unsigned<bool> : true_type {};
338 template <> struct is_unsigned<char> : etl::bool_constant<(char(255) > 0)> {};
339 template <> struct is_unsigned<unsigned char> : true_type {};
340 template <> struct is_unsigned<wchar_t> : public etl::bool_constant<(wchar_t(-1) > wchar_t(0))> {};
341 template <>
struct is_unsigned<unsigned short> : true_type {};
342 template <>
struct is_unsigned<unsigned int> : true_type {};
343 template <>
struct is_unsigned<unsigned long> : true_type {};
344 template <>
struct is_unsigned<unsigned long long> : true_type {};
345 template <
typename T>
struct is_unsigned<const T> : is_unsigned<T> {};
346 template <
typename T>
struct is_unsigned<volatile T> : is_unsigned<T> {};
347 template <
typename T>
struct is_unsigned<const volatile T> : is_unsigned<T> {};
350 template <
typename T>
351 inline constexpr bool is_unsigned_v = is_unsigned<T>::value;
356 template <
typename T>
struct is_floating_point :
false_type {};
357 template <>
struct is_floating_point<float> : true_type {};
358 template <>
struct is_floating_point<double> : true_type {};
359 template <>
struct is_floating_point<long double> : true_type {};
360 template <
typename T>
struct is_floating_point<const T> : is_floating_point<T> {};
361 template <
typename T>
struct is_floating_point<volatile T> : is_floating_point<T> {};
362 template <
typename T>
struct is_floating_point<const volatile T> : is_floating_point<T> {};
365 template <
typename T>
366 inline constexpr bool is_floating_point_v = is_floating_point<T>::value;
371 template <
typename T1,
typename T2>
struct is_same :
public false_type {};
372 template <
typename T>
struct is_same<T, T> :
public true_type {};
375 template <
typename T1,
typename T2>
376 inline constexpr bool is_same_v = is_same<T1, T2>::value;
381 template<
typename T>
struct is_void :
false_type {};
382 template<>
struct is_void<void> : true_type {};
385 template <
typename T>
386 inline constexpr bool is_void_v = is_void<T>::value;
391 template<
typename T>
struct is_arithmetic :
etl::bool_constant<is_integral<T>::value || is_floating_point<T>::value> {};
394 template <
typename T>
395 inline constexpr bool is_arithmetic_v = is_arithmetic<T>::value;
400 template <
typename T>
struct is_fundamental :
etl::bool_constant<is_arithmetic<T>::value || is_void<T>::value> {};
403 template <
typename T>
404 inline constexpr bool is_fundamental_v = is_fundamental<T>::value;
409 template <
typename T>
struct is_compound :
etl::bool_constant<!is_fundamental<T>::value> {};
412 template <
typename T>
413 inline constexpr bool is_compound_v = is_compound<T>::value;
418 template <
typename T>
struct is_array :
false_type {};
419 template <
typename T>
struct is_array<T[]> : true_type {};
420 template <
typename T,
size_t MAXN>
struct is_array<T[MAXN]> : true_type {};
423 template <
typename T>
424 inline constexpr bool is_array_v = is_array<T>::value;
429 template<
typename T>
struct is_pointer_helper :
false_type {};
430 template<
typename T>
struct is_pointer_helper<T*> : true_type {};
431 template<
typename T>
struct is_pointer : is_pointer_helper<typename remove_cv<T>::type> {};
434 template <
typename T>
435 inline constexpr bool is_pointer_v = is_pointer<T>::value;
440 template<
typename T>
struct is_lvalue_reference_helper :
false_type {};
441 template<
typename T>
struct is_lvalue_reference_helper<T&> : true_type {};
442 template<
typename T>
struct is_lvalue_reference : is_lvalue_reference_helper<typename remove_cv<T>::type> {};
445 template <
typename T>
452 template<
typename T>
struct is_rvalue_reference_helper :
false_type {};
453 template<
typename T>
struct is_rvalue_reference_helper<T&&> : true_type {};
454 template<
typename T>
struct is_rvalue_reference : is_rvalue_reference_helper<typename remove_cv<T>::type> {};
457 template <
typename T>
465 template<
typename T>
struct is_reference : integral_constant<bool,
466 is_lvalue_reference<T>::value
468 || is_rvalue_reference<T>::value
473 template <
typename T>
474 inline constexpr bool is_reference_v = is_reference<T>::value;
480 template <
typename T>
struct is_pod :
etl::bool_constant<etl::is_fundamental<T>::value || etl::is_pointer<T>::value> {};
483 template <
typename T>
489 template <
bool B,
typename T,
typename F>
struct conditional {
typedef T type; };
490 template <
typename T,
typename F>
struct conditional<false, T, F> {
typedef F type; };
493 template <
bool B,
typename T,
typename F>
494 using conditional_t =
typename conditional<B, T, F>::type;
499 template <
typename T>
struct make_signed {
typedef T type; };
500 template <>
struct make_signed<char> {
typedef signed char type; };
501 template <>
struct make_signed<unsigned char> {
typedef signed char type; };
503 template <>
struct make_signed<wchar_t>
509 void>::type>::type type;
512 template <>
struct make_signed<unsigned short> {
typedef short type; };
513 template <>
struct make_signed<unsigned int> {
typedef int type; };
514 template <>
struct make_signed<unsigned long> {
typedef long type; };
515 template <>
struct make_signed<unsigned long long> {
typedef long long type; };
516 template <
typename T>
struct make_signed<const T> : add_const<typename make_signed<T>::type> {};
517 template <
typename T>
struct make_signed<volatile T> : add_volatile<typename make_signed<T>::type> {};
518 template <
typename T>
struct make_signed<const volatile T> : add_const<typename add_volatile<typename make_signed<T>::type>::type> {};
521 template <
typename T>
522 using make_signed_t =
typename make_signed<T>::type;
527 template <
typename T>
struct make_unsigned {
typedef T type; };
528 template <>
struct make_unsigned<char> {
typedef unsigned char type; };
529 template <>
struct make_unsigned<signed char> {
typedef unsigned char type; };
530 template <>
struct make_unsigned<short> {
typedef unsigned short type; };
532 template <>
struct make_unsigned<wchar_t>
538 void>::type>::type type;
541 template <>
struct make_unsigned<int> {
typedef unsigned int type; };
542 template <>
struct make_unsigned<long> {
typedef unsigned long type; };
543 template <>
struct make_unsigned<long long> {
typedef unsigned long long type; };
544 template <
typename T>
struct make_unsigned<const T> : add_const<typename make_unsigned<T>::type> {};
545 template <
typename T>
struct make_unsigned<volatile T> : add_volatile<typename make_unsigned<T>::type> {};
546 template <
typename T>
struct make_unsigned<const volatile T> : add_const<typename add_volatile<typename make_unsigned<T>::type>::type> {};
549 template <
typename T>
550 using make_unsigned_t =
typename make_unsigned<T>::type;
555 template <
bool B,
typename T =
void>
struct enable_if {};
556 template <
typename T>
struct enable_if<true, T> {
typedef T type; };
559 template <
bool B,
typename T =
void>
560 using enable_if_t =
typename enable_if<B, T>::type;
565 template <
typename T,
unsigned MAXN = 0U>
566 struct extent : integral_constant<size_t, 0U> {};
568 template <
typename T>
569 struct extent<T[], 0> : integral_constant<size_t, 0U> {};
571 template <
typename T,
unsigned MAXN>
572 struct extent<T[], MAXN> : integral_constant<size_t, extent<T, MAXN - 1>::value> {};
574 template <
typename T,
unsigned MAXN>
575 struct extent<T[MAXN], 0> : integral_constant<size_t, MAXN> {};
577 template <
typename T,
unsigned I,
unsigned MAXN>
578 struct extent<T[I], MAXN> : integral_constant<size_t, extent<T, MAXN - 1>::value> {};
581 template <
typename T,
unsigned N = 0U>
582 inline constexpr size_t extent_v = extent<T, N>::value;
587 template <
typename T>
struct remove_extent {
typedef T type; };
588 template <
typename T>
struct remove_extent<T[]> {
typedef T type; };
589 template <
typename T,
size_t MAXN>
struct remove_extent<T[MAXN]> {
typedef T type; };
592 template <
typename T>
593 using remove_extent_t =
typename remove_extent<T>::type;
598 template <
typename T>
struct remove_all_extents {
typedef T type; };
599 template <
typename T>
struct remove_all_extents<T[]> {
typedef typename remove_all_extents<T>::type type; };
600 template <
typename T,
size_t MAXN>
struct remove_all_extents<T[MAXN]> {
typedef typename remove_all_extents<T>::type type; };
603 template <
typename T>
604 using remove_all_extents_t =
typename remove_all_extents<T>::type;
609 template <
typename T>
struct rank : integral_constant<size_t, 0> {};
610 template <
typename T>
struct rank<T[]> :
public integral_constant<size_t, rank<T>::value + 1> {};
611 template <
typename T,
size_t MAXN>
struct rank<T[MAXN]> :
public integral_constant<size_t, rank<T>::value + 1> {};
614 template <
typename T>
615 inline constexpr size_t rank_v = rank<T>::value;
620 template <
typename T>
630 template <
typename T>
631 using decay_t =
typename decay<T>::type;
636 template<
typename TBase,
643 template<
typename T>
struct dummy {};
644 struct internal: TDerived, dummy<int>{};
646 static TBase* check(TBase*) {
return (TBase*)0; }
649 static char check(dummy<T>*) {
return 0; }
653 static const bool value = (
sizeof(check((internal*)0)) ==
sizeof(TBase*));
657 template<
typename TBase,
typename TDerived>
658 struct is_base_of<TBase, TDerived, true>
660 static const bool value =
false;
664 template <
typename T1,
typename T2>
665 inline constexpr bool is_base_of_v = is_base_of<T1, T2>::value;
670 namespace private_type_traits
672 template <
typename T>
char test(
int T::*);
674 struct dummy {
char c[2]; };
675 template <
typename T> dummy test(...);
678 template <
typename T>
682 template <
typename T>
683 inline constexpr bool is_class_v = is_class<T>::value;
688 template <
typename T>
struct add_lvalue_reference {
typedef T& type; };
689 template <
typename T>
struct add_lvalue_reference<T&> {
typedef T& type; };
690 template <>
struct add_lvalue_reference<void> {
typedef void type; };
691 template <>
struct add_lvalue_reference<const void> {
typedef const void type; };
692 template <>
struct add_lvalue_reference<volatile void> {
typedef volatile void type; };
693 template <>
struct add_lvalue_reference<const volatile void> {
typedef const volatile void type; };
696 template <
typename T>
703 template <
typename T>
struct add_rvalue_reference {
using type = T && ; };
704 template <
typename T>
struct add_rvalue_reference<T&> {
using type = T & ; };
705 template <>
struct add_rvalue_reference<void> {
using type = void; };
706 template <>
struct add_rvalue_reference<const void> {
using type =
const void; };
707 template <>
struct add_rvalue_reference<volatile void> {
using type =
volatile void; };
708 template <>
struct add_rvalue_reference<const volatile void> {
using type =
const volatile void; };
712 template <
typename T>
719 template <
typename T>
729 namespace private_type_traits
732 template <
typename T,
typename =
int>
739 template <
typename T>
740 struct is_convertible_to_int<T, decltype(static_cast<int>(declval<T>()))>
746 template <
typename T>
748 : integral_constant<bool, private_type_traits::is_convertible_to_int<T>::value &&
749 !is_class<T>::value &&
750 !is_arithmetic<T>::value &&
751 !is_reference<T>::value>
756 template <
typename T>
765 namespace private_type_traits
770 template <
typename T>
776 template <
typename TFrom,
typename TTo>
779 template <
typename,
typename>
783#if defined(ETL_COMPILER_ARM5)
784 template <
typename TFrom,
typename TTo>
787 template <
typename TFrom,
typename TTo>
788 struct is_convertible :
etl::bool_constant<(decltype(private_type_traits::returnable<TTo>(0))::value &&
789 decltype(private_type_traits::nonvoid_convertible<TFrom, TTo>(0))::value) ||
790 (etl::is_void<TFrom>::value && etl::is_void<TTo>::value)> {};
795 template <
typename TFrom,
typename TTo >
802#if ETL_USING_CPP11 && !defined(ETL_COMPILER_ARM5)
803 template <
typename T>
struct alignment_of : integral_constant<size_t, alignof(T)> { };
804#elif defined(ETL_COMPILER_MICROSOFT)
805 template <
typename T>
struct alignment_of : integral_constant<size_t, size_t(__alignof(T))> {};
806#elif defined(ETL_COMPILER_IAR) || defined(ETL_COMPILER_TI)
807 template <
typename T>
struct alignment_of : integral_constant<size_t, size_t(__ALIGNOF__(T))> {};
809 template <
typename T>
struct alignment_of : integral_constant<size_t, size_t(__alignof__(T))> {};
814 template <>
struct alignment_of<void> : integral_constant <size_t, 0> {};
815 template <>
struct alignment_of<const void> : integral_constant <size_t, 0> {};
818 template <
typename T>
831 template <
typename T, T VALUE>
840 template <
typename T, T VALUE>
861 template <
typename T>
864 template <
typename T>
871 template <
typename T>
872 inline constexpr bool negation_v = std::negation_v<T>;
881 template <
typename T>
891 template <
typename T>
898 template <
typename T>
struct add_pointer : std::add_pointer<T> {};
901 template <
typename T>
908 template <
typename T>
struct is_const : std::is_const<T> {};
911 template <
typename T>
912 inline constexpr bool is_const_v = std::is_const_v<T>;
921 template <
typename T>
928 template <
typename T>
struct add_const : std::add_const<T> {};
931 template <
typename T>
932 using add_const_t =
typename std::add_const<T>::type;
938 template <
typename T>
struct is_volatile : std::is_volatile<T> {};
941 template <
typename T>
951 template <
typename T>
961 template <
typename T>
968 template <
typename T>
struct remove_cv : std::remove_cv<T> {};
971 template <
typename T>
972 using remove_cv_t =
typename std::remove_cv<T>::type;
978 template <
typename T>
struct add_cv : std::add_cv<T> {};
981 template <
typename T>
982 using add_cv_t =
typename std::add_cv<T>::type;
990 typedef typename std::remove_cv<typename std::remove_reference<T>::type>::type type;
994 template <
typename T>
1004 template <
typename T>
1005 inline constexpr bool is_integral_v = std::is_integral_v<T>;
1011 template <
typename T>
struct is_signed : std::is_signed<T> {};
1014 template <
typename T>
1015 inline constexpr bool is_signed_v = std::is_signed_v<T>;
1024 template <
typename T>
1025 inline constexpr bool is_unsigned_v = std::is_unsigned_v<T>;
1034 template <
typename T>
1041 template <
typename T1,
typename T2>
struct is_same : std::is_same<T1, T2> {};
1044 template <
typename T1,
typename T2>
1045 inline constexpr bool is_same_v = std::is_same_v<T1, T2>;
1051 template<
typename T>
struct is_void : std::is_void<T> {};
1054 template <
typename T>
1055 inline constexpr bool is_void_v = std::is_void_v<T>;
1064 template <
typename T>
1074 template <
typename T>
1084 template <
typename T>
1085 inline constexpr bool is_compound_v = std::is_compound_v<T>;
1091 template <
typename T>
struct is_array : std::is_array<T> {};
1094 template <
typename T>
1095 inline constexpr bool is_array_v = std::is_array_v<T>;
1104 template <
typename T>
1105 inline constexpr bool is_pointer_v = std::is_pointer_v<T>;
1114 template <
typename T>
1124 template <
typename T>
1135 template <
typename T>
1136 inline constexpr bool is_rvalue_reference_v = std::is_rvalue_reference_v<T>;
1143 template <
typename T>
1144 struct is_pod : std::integral_constant<bool, std::is_standard_layout<T>::value && std::is_trivial<T>::value> {};
1147 template <
typename T>
1148 inline constexpr bool is_pod_v = std::is_standard_layout_v<T> && std::is_trivial_v<T>;
1151#if defined(ETL_COMPILER_GCC)
1152 #if ETL_COMPILER_VERSION >= 5
1153 #define ETL_GCC_V5_TYPE_TRAITS_SUPPORTED
1164 template <
bool B,
typename T,
typename F>
1174 template <
typename T>
1184 template <
typename T>
1191 template <
bool B,
typename T =
void>
struct enable_if : std::enable_if<B, T> {};
1194 template <
bool B,
typename T =
void>
1195 using enable_if_t =
typename std::enable_if<B, T>::type;
1201 template <
typename T,
unsigned MAXN = 0U>
1205 template <
typename T,
unsigned MAXN = 0U>
1206 inline constexpr size_t extent_v = std::extent_v<T, MAXN>;
1215 template <
typename T>
1225 template <
typename T>
1232 template <
typename T>
struct rank : std::rank<T> {};
1235 template <
typename T>
1236 inline constexpr size_t rank_v = std::rank_v<T>;
1242 template <
typename T>
struct decay : std::decay<T> {};
1245 template <
typename T>
1246 using decay_t =
typename std::decay<T>::type;
1252 template<
typename TBase,
typename TDerived>
struct is_base_of : std::is_base_of<TBase, TDerived> {};
1255 template <
typename TBase,
typename TDerived>
1256 inline constexpr bool is_base_of_v = std::is_base_of_v<TBase, TDerived>;
1261 template <
typename T>
struct is_class : std::is_class<T>{};
1264 template <
typename T>
1273 template <
typename T>
1284 template <
typename T>
1285 using add_rvalue_reference_t =
typename std::add_rvalue_reference<T>::type;
1291 template <
typename T>
1292 typename std::add_rvalue_reference<T>::type declval() ETL_NOEXCEPT;
1299 template <
typename T>
1300 struct is_enum : std::is_enum<T>
1305 template <
typename T>
1315 template <
typename TFrom,
typename TTo>
1316 struct is_convertible : std::is_convertible<TFrom, TTo> {};
1320 template <
typename TFrom,
typename TTo>
1321 inline constexpr bool is_convertible_v = std::is_convertible_v<TFrom, TTo>;
1332 template <
typename T>
1345 template <
bool B,
typename T, T TRUE_VALUE, T FALSE_VALUE>
1348 template <
typename T, T TRUE_VALUE, T FALSE_VALUE>
1355 template <
typename T, T TRUE_VALUE, T FALSE_VALUE>
1366 template <
typename T,
typename T1,
typename...
TRest>
1373 template <
typename T,
typename T1>
1374 struct is_one_of<T, T1>
1405 template <
typename T,
typename... TRest>
1406 inline constexpr bool is_one_of_v =
etl::is_one_of<T, TRest...>::value;
1413 template <
typename T,
typename T1,
typename... TRest>
1414 struct is_base_of_all
1420 template <
typename T,
typename T1>
1421 struct is_base_of_all<T, T1>
1428 template <
typename T,
typename... TRest>
1436 template <
typename T,
typename T1,
typename... TRest>
1437 struct is_base_of_any
1443 template <
typename T,
typename T1>
1444 struct is_base_of_any<T, T1>
1451 template <
typename T,
typename... TRest>
1460 template <
typename T>
1482 template <
typename T>
1504 template <
typename T>
1526 template <
typename T>
1549 template <
typename T>
1558 typedef type_t type;
1559 typedef type_t& reference;
1560 typedef const type_t& const_reference;
1561 typedef type_t* pointer;
1562 typedef const type_t* const_pointer;
1563 typedef const type_t*
const const_pointer_const;
1572 template <
typename T>
1573 using types_t =
typename types<T>::type;
1575 template <
typename T>
1576 using types_r =
typename types<T>::reference;
1578 template <
typename T>
1579 using types_cr =
typename types<T>::const_reference;
1581 template <
typename T>
1582 using types_rr =
typename types<T>::rvalue_reference;
1584 template <
typename T>
1585 using types_p =
typename types<T>::pointer;
1587 template <
typename T>
1588 using types_cp =
typename types<T>::const_pointer;
1590 template <
typename T>
1591 using types_cpc =
typename types<T>::const_pointer_const;
1601 template <
typename T>
1608 template <
typename T,
typename T1,
typename...
TRest>
1615 template <
typename T,
typename T1>
1616 struct are_all_same<T, T1>
1623 template <
typename T,
typename T1,
typename... TRest>
1624 inline constexpr bool are_all_same_v = are_all_same<T, T1, TRest...>::value;
1630 template <
typename...>
1635 template <
typename T1,
typename... Tn>
1636 struct conjunction<T1, Tn...> :
public etl::conditional_t<bool(T1::value), etl::conjunction<Tn...>, T1>
1640 template <
typename T>
1641 struct conjunction<T> :
public T
1647 template <
typename... T>
1648 inline constexpr bool conjunction_v = conjunction<T...>::value;
1654 template <
typename...>
1659 template <
typename T1,
typename... Tn>
1660 struct disjunction<T1, Tn...> :
public etl::conditional_t<bool(T1::value), T1, disjunction<Tn...>>
1664 template <
typename T1>
struct disjunction<T1> :
public T1
1670 template <
typename... T>
1675#if ETL_USING_STL && ETL_USING_CPP11 && !defined(ETL_USE_TYPE_TRAITS_BUILTINS) && !defined(ETL_USER_DEFINED_TYPE_TRAITS) && ((!defined(ARDUINO) && ETL_NOT_USING_STLPORT) || defined(ETL_GCC_V5_TYPE_TRAITS_SUPPORTED))
1683 template<
typename T1,
typename T2>
1684 using is_assignable = std::is_assignable<T1, T2>;
1688 template<
typename T,
typename... TArgs>
1689 using is_constructible = std::is_constructible<T, TArgs...>;
1693 template <
typename T>
1694 using is_copy_constructible = std::is_copy_constructible<T>;
1698 template <
typename T>
1699 using is_move_constructible = std::is_move_constructible<T>;
1703#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
1704 template <
typename T>
1705 using is_trivially_constructible = std::is_trivially_constructible<T>;
1707 template <
typename T>
1713#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
1714 template <
typename T>
1715 using is_trivially_copy_constructible = std::is_trivially_copy_constructible<T>;
1717 template <
typename T>
1723#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
1724 template <
typename T>
1725 using is_trivially_destructible = std::is_trivially_destructible<T>;
1727 template <
typename T>
1733#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
1734 template <
typename T>
1735 using is_trivially_copy_assignable = std::is_trivially_copy_assignable<T>;
1737 template <
typename T>
1743#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
1744 template <
typename T>
1745 using is_trivially_copyable = std::is_trivially_copyable<T>;
1747 template <
typename T>
1751#elif defined(ETL_USE_TYPE_TRAITS_BUILTINS) && !defined(ETL_USER_DEFINED_TYPE_TRAITS)
1759 template<
typename T1,
typename T2>
1760 struct is_assignable
1762 static ETL_CONSTANT
bool value = __is_assignable(T1, T2);
1768 template<
typename T,
typename... TArgs>
1769 struct is_constructible
1776 template<
typename T,
typename TArgs =
void>
1777 struct is_constructible
1784 template<
typename T>
1785 struct is_constructible<T, void>
1793 template <
typename T>
1794 struct is_copy_constructible :
public etl::is_constructible<T, typename etl::add_lvalue_reference<const T>::type>
1800 template <
typename T>
1808 template <
typename T,
typename... TArgs>
1809 struct is_trivially_constructible
1811#if defined(ETL_COMPILER_GCC)
1812 static ETL_CONSTANT
bool value = __has_trivial_constructor(T);
1814 static ETL_CONSTANT
bool value = __is_trivially_constructible(T, TArgs...);
1820 template <
typename T,
typename TArgs =
void>
1821 struct is_trivially_constructible
1823#if defined(ETL_COMPILER_GCC)
1824 static ETL_CONSTANT
bool value = __has_trivial_constructor(T);
1826 static ETL_CONSTANT
bool value = __is_trivially_constructible(T, TArgs);
1832 template <
typename T>
1833 struct is_trivially_constructible<T, void>
1835#if defined(ETL_COMPILER_GCC)
1836 static ETL_CONSTANT
bool value = __has_trivial_constructor(T);
1838 static ETL_CONSTANT
bool value = __is_trivially_constructible(T);
1845 template <
typename T>
1846 struct is_trivially_copy_constructible :
public is_trivially_constructible<T, typename add_lvalue_reference<const T>::type>
1852 template <
typename T>
1853 struct is_trivially_destructible
1855#if defined(ETL_COMPILER_GCC)
1856 static ETL_CONSTANT
bool value = __has_trivial_destructor(T);
1858 static ETL_CONSTANT
bool value = __is_trivially_destructible(T);
1864 template <
typename T>
1865 struct is_trivially_copy_assignable
1867#if defined(ETL_COMPILER_GCC)
1868 static ETL_CONSTANT
bool value = __has_trivial_copy(T);
1870 static ETL_CONSTANT
bool value = __is_trivially_copyable(T);
1876 template <
typename T>
1877 struct is_trivially_copyable
1879#if defined(ETL_COMPILER_GCC)
1880 static ETL_CONSTANT
bool value = __has_trivial_copy(T);
1882 static ETL_CONSTANT
bool value = __is_trivially_copyable(T);
1886#elif defined(ETL_USER_DEFINED_TYPE_TRAITS) && !defined(ETL_USE_TYPE_TRAITS_BUILTINS)
1895 template <
typename T1,
1898 struct is_assignable;
1900 template <
typename T1,
typename T2>
1905 template <
typename T1,
typename T2>
1906 struct is_assignable<T1, T2, false>;
1911 template <
typename T,
bool B,
typename... TArgs>
1912 struct is_constructible_helper;
1914 template <
typename T,
typename... TArgs>
1915 struct is_constructible_helper<T, true, TArgs...> :
public etl::true_type
1919 template <
typename T,
typename... TArgs>
1920 struct is_constructible_helper<T, false, TArgs...>;
1922 template <
typename T,
typename... TArgs>
1923 struct is_constructible :
public is_constructible_helper<T, etl::is_arithmetic<T>::value || etl::is_pointer<T>::value, TArgs...>
1931 struct is_copy_constructible;
1933 template <
typename T>
1938 template <
typename T>
1939 struct is_copy_constructible<T, false>;
1944 struct is_move_constructible;
1946 template <
typename T>
1951 template <
typename T>
1952 struct is_move_constructible<T, false>;
1957 struct is_trivially_constructible;
1959 template <
typename T>
1960 struct is_trivially_constructible<T, true> :
public etl::true_type
1964 template <
typename T>
1965 struct is_trivially_constructible<T, false>;
1970 struct is_trivially_copy_constructible;
1972 template <
typename T>
1973 struct is_trivially_copy_constructible<T, true> :
public etl::true_type
1977 template <
typename T>
1978 struct is_trivially_copy_constructible<T, false>;
1983 struct is_trivially_destructible;
1985 template <
typename T>
1986 struct is_trivially_destructible<T, true> :
public etl::true_type
1990 template <
typename T>
1991 struct is_trivially_destructible<T, false>;
1996 struct is_trivially_copy_assignable;
1998 template <
typename T>
1999 struct is_trivially_copy_assignable<T, true> :
public etl::true_type
2003 template <
typename T>
2004 struct is_trivially_copy_assignable<T, false>;
2009 struct is_trivially_copyable;
2011 template <
typename T>
2016 template <
typename T>
2017 struct is_trivially_copyable<T, false>;
2028 template <
typename T1,
typename T2>
2029 struct is_assignable :
public etl::bool_constant<(etl::is_arithmetic<T1>::value || etl::is_pointer<T1>::value) && (etl::is_arithmetic<T2>::value || etl::is_pointer<T2>::value)>
2038 template <
class,
class T,
class...
Args>
2041 template <
class T,
class...
Args>
2047 template <
class T,
class... Args>
2048 using is_constructible = private_type_traits::is_constructible_<void_t<>, T, Args...>;
2052 template <
class T>
struct is_copy_constructible :
public is_constructible<T, typename etl::add_lvalue_reference<typename etl::add_const<T>::type>::type>{};
2053 template <>
struct is_copy_constructible<void> :
public false_type{};
2054 template <>
struct is_copy_constructible<void const> :
public false_type{};
2055 template <>
struct is_copy_constructible<void volatile> :
public false_type{};
2056 template <>
struct is_copy_constructible<void const volatile> :
public false_type{};
2060 template <
typename T>
struct is_move_constructible:
public is_constructible<T, typename etl::add_rvalue_reference<T>::type>{};
2061 template <>
struct is_move_constructible<void> :
public false_type{};
2062 template <>
struct is_move_constructible<void const> :
public false_type{};
2063 template <>
struct is_move_constructible<void volatile> :
public false_type{};
2064 template <>
struct is_move_constructible<void const volatile> :
public false_type{};
2070 template <
typename T>
2077 template <
typename T>
2085 template <
typename T>
2092 template <
typename T>
2099 template <
typename T>
2106 template <
typename T>
2113 template <
typename T>
2120 template <
typename T1,
typename T2>
2122 typename etl::add_lvalue_reference<typename etl::add_const<T2>::type>::type>
2129 template<
typename T,
typename =
void>
2132 template<
typename T>
2133 struct is_default_constructible<T,
etl::void_t<decltype(T())>> :
etl::true_type { };
2135 template <
typename T>
2143 template <
typename T1,
typename T2>
2146 template <
typename T1,
typename T2>
2149 template<
typename T,
typename...
TArgs>
2152 template<
typename T,
typename...
TArgs>
2155 template<
typename T>
2158 template<
typename T>
2161 template <
typename T>
2164 template <
typename T>
2167 template <
typename T>
2170 template <
typename T>
2173 template <
typename T>
2186 template<
typename...>
2193 template <
typename T>
2194 struct common_type<T> : common_type<T, T>
2198 namespace private_common_type
2200 template <
typename T1,
typename T2>
2201 using conditional_result_t =
decltype(
false ? declval<T1>() : declval<T2>());
2203 template <
typename,
typename,
typename =
void>
2204 struct decay_conditional_result
2208 template <
typename T1,
typename T2>
2209 struct decay_conditional_result<T1, T2, void_t<conditional_result_t<T1, T2>>>
2214 template <
typename T1,
typename T2,
typename =
void>
2215 struct common_type_2_impl : decay_conditional_result<const T1&, const T2&>
2219 template <
typename T1,
typename T2>
2220 struct common_type_2_impl<T1, T2, void_t<conditional_result_t<T1, T2>>>
2221 : decay_conditional_result<T1, T2>
2228 template <
typename T1,
typename T2>
2229 struct common_type<T1, T2>
2230 :
etl::conditional<etl::is_same<T1, typename etl::decay<T1>::type>::value&& etl::is_same<T2, typename etl::decay<T2>::type>::value,
2231 private_common_type::common_type_2_impl<T1, T2>,
2232 common_type<typename etl::decay<T2>::type,
2233 typename etl::decay<T2>::type>>::type
2239 namespace private_common_type
2246 template <
typename T1,
typename T2,
typename...
TRest>
2248 :
common_type<typename common_type<T1, T2>::type, TRest...>
2253 template<
typename T1,
typename T2,
typename... TRest>
2254 struct common_type<T1, T2, TRest...>
2255 : private_common_type::common_type_multi_impl<void, T1, T2, TRest...>
2259 template <
typename... T>
2260 using common_type_t =
typename common_type<T...>::type;
2266 template <
typename T>
2273 unsigned long long>::type>::type>::type>::type
type;
2277 template <
typename T>
2284 template <
typename T>
2291 long long>::type>::type>::type>::type
type;
2295 template <
typename T>
2302 template <
typename T>
2306 template <
typename T>
2313 template <
typename...
TTypes>
2319 has_duplicates<TRest...>> {};
2320 template <
typename TFirst>
2327 template <
typename... TTypes>
2334 template <
typename T,
typename... TTypes>
2337 template <
typename T,
typename U,
typename... URest>
2339 etl::is_same<T, U>::value +
2340 count_of<T, URest...>::value> {};
2342 template <
typename T>
2347 template <
typename T,
typename... TTypes>
2348 inline constexpr size_t count_of_v =
etl::count_of<T, TTypes...>::value;
2354 template <
typename T,
typename... TTypes>
2355 struct has_duplicates_of :
etl::bool_constant<(etl::count_of<T, TTypes...>::value > 1U)> {};
2359 template <
typename T,
typename... TTypes>
2365#define ETL_IS_CHAR_TYPE(type) (etl::is_same<char, type>::value || etl::is_same<signed char, type>::value || etl::is_same<unsigned char, type>::value)
2366#define ETL_IS_NOT_CHAR_TYPE(type) (!ETL_IS_CHAR_TYPE(type))
2368#define ETL_IS_POINTER_TYPE(type) (etl::is_pointer<type>::value)
2369#define ETL_IS_NOT_POINTER_TYPE(type) (!ETL_IS_POINTER_TYPE(type))
2371#define ETL_TARGET_IS_TRIVIALLY_COPYABLE(type) (etl::is_trivially_copyable<typename etl::iterator_traits<type>::value_type>::value)
2372#define ETL_TARGET_IS_NOT_TRIVIALLY_COPYABLE(type) (!ETL_TARGET_IS_TRIVIALLY_COPYABLE(type))
integral_constant< bool, false > false_type
integral_constant specialisations
Definition type_traits_generator.h:836
add_const
Definition type_traits_generator.h:928
add_cv
Definition type_traits_generator.h:978
add_pointer
Definition type_traits_generator.h:898
add_volatile
Definition type_traits_generator.h:958
add_rvalue_reference
Definition type_traits_generator.h:1327
conditional
Definition type_traits_generator.h:1160
decay
Definition type_traits_generator.h:1242
enable_if
Definition type_traits_generator.h:1191
extent
Definition type_traits_generator.h:1202
integral_constant
Definition type_traits_generator.h:832
is_arithmetic
Definition type_traits_generator.h:1061
is_array
Definition type_traits_generator.h:1091
is_base_of
Definition type_traits_generator.h:1252
is_compound
Definition type_traits_generator.h:1081
is_const
Definition type_traits_generator.h:908
is_floating_point
Definition type_traits_generator.h:1031
is_fundamental
Definition type_traits_generator.h:1071
is_integral
Definition type_traits_generator.h:1001
is_lvalue_reference
Definition type_traits_generator.h:1121
is_rvalue_reference
Definition type_traits_generator.h:1144
is_pointer
Definition type_traits_generator.h:1101
is_reference
Definition type_traits_generator.h:1111
is_same
Definition type_traits_generator.h:1041
is_signed
Definition type_traits_generator.h:1011
is_unsigned
Definition type_traits_generator.h:1021
is_void
Definition type_traits_generator.h:1051
is_volatile
Definition type_traits_generator.h:938
make_signed
Definition type_traits_generator.h:1171
make_unsigned
Definition type_traits_generator.h:1181
negation
Definition type_traits_generator.h:866
rank
Definition type_traits_generator.h:1232
remove_all_extents
Definition type_traits_generator.h:1222
remove_const
Definition type_traits_generator.h:918
remove_cv
Definition type_traits_generator.h:968
remove_cvref
Definition type_traits_generator.h:989
remove_extent
Definition type_traits_generator.h:1212
remove_pointer
Definition type_traits_generator.h:888
remove_reference
Definition type_traits_generator.h:878
remove_volatile
Definition type_traits_generator.h:948
bitset_ext
Definition absolute.h:38
add_lvalue_reference
Definition type_traits_generator.h:1270
Definition type_traits_generator.h:849
conditional_integral_constant
Definition type_traits_generator.h:1346
conjunction
Definition type_traits_generator.h:2030
is_class
Definition type_traits_generator.h:1261
Definition type_traits_generator.h:2072
Definition type_traits_generator.h:2137
Definition type_traits_generator.h:2123
Definition type_traits_generator.h:2079
Definition type_traits_generator.h:2087
Definition type_traits_generator.h:2108
Definition type_traits_generator.h:2094
Definition type_traits_generator.h:2115
Definition type_traits_generator.h:2101
pair holds two objects of arbitrary type
Definition utility.h:164
ETL_CONSTEXPR pair()
Default constructor.
Definition utility.h:176
Defines one of five signed types that has the same size as T.
Definition type_traits_generator.h:2286
size_of
Definition type_traits_generator.h:1597
Definition type_traits_generator.h:2303
A set of templates to allow related types to be derived.
Definition type_traits_generator.h:1462
Defines one of five unsigned types that has the same size as T.
Definition type_traits_generator.h:2268
void add_pointer(const volatile void *value, TIString &str, const etl::basic_format_spec< TIString > &format, const bool append)
Helper function for pointers.
Definition to_string_helper.h:443