32 #error THIS HEADER IS A GENERATOR. DO NOT INCLUDE.
53 #ifndef ETL_TYPE_TRAITS_INCLUDED
54 #define ETL_TYPE_TRAITS_INCLUDED
61 #include "static_assert.h"
68 #if ETL_USING_STL && ETL_CPP11_SUPPORTED
69 #include <type_traits>
74 #if ETL_NOT_USING_STL || ETL_CPP11_NOT_SUPPORTED
81 template <
typename T, const T VALUE>
82 struct integral_constant
84 static const T value = VALUE;
87 typedef integral_constant<T, VALUE> type;
89 operator value_type()
const
96 typedef integral_constant<bool, false>
false_type;
97 typedef integral_constant<bool, true> true_type;
99 template <
typename T, const T VALUE>
100 const T integral_constant<T, VALUE>::value;
102 #if ETL_CPP11_SUPPORTED
104 using bool_constant = integral_constant<bool, B>;
112 template <
typename T>
117 #if ETL_CPP17_SUPPORTED
118 template <
typename T>
127 #if ETL_CPP14_SUPPORTED
128 template <
typename T>
129 using remove_reference_t =
typename remove_reference<T>::type;
137 template <
typename T>
struct remove_pointer<volatile T*> {
typedef volatile T type; };
138 template <
typename T>
struct remove_pointer<const volatile T*> {
typedef const volatile T type; };
140 template <
typename T>
struct remove_pointer<const T*
const> {
typedef const T type; };
141 template <
typename T>
struct remove_pointer<volatile T*
const> {
typedef volatile T type; };
142 template <
typename T>
struct remove_pointer<const volatile T*
const> {
typedef const volatile T type; };
144 #if ETL_CPP14_SUPPORTED
145 template <
typename T>
146 using remove_pointer_t =
typename remove_pointer<T>::type;
151 template <
typename T>
struct add_pointer {
typedef typename remove_reference<T>::type* type; };
153 #if ETL_CPP14_SUPPORTED
154 template <
typename T>
155 using add_pointer_t =
typename add_pointer<T>::type;
160 template <
typename T>
struct is_const :
false_type {};
164 #if ETL_CPP17_SUPPORTED
165 template <
typename T>
171 template <
typename T>
struct remove_const {
typedef T type; };
172 template <
typename T>
struct remove_const<const T> {
typedef T type; };
174 #if ETL_CPP14_SUPPORTED
175 template <
typename T>
176 using remove_const_t =
typename remove_const<T>::type;
181 template <
typename T>
struct add_const {
typedef const T type; };
182 template <
typename T>
struct add_const<const T> {
typedef const T type; };
184 #if ETL_CPP14_SUPPORTED
185 template <
typename T>
186 using add_const_t =
typename add_const<T>::type;
195 #if ETL_CPP17_SUPPORTED
196 template <
typename T>
205 #if ETL_CPP14_SUPPORTED
206 template <
typename T>
207 using remove_volatile_t =
typename remove_volatile<T>::type;
212 template <
typename T>
struct add_volatile {
typedef volatile T type; };
213 template <
typename T>
struct add_volatile<volatile T> {
typedef volatile T type; };
215 #if ETL_CPP14_SUPPORTED
216 template <
typename T>
217 using add_volatile_t =
typename add_volatile<T>::type;
227 #if ETL_CPP14_SUPPORTED
228 template <
typename T>
229 using remove_cv_t =
typename remove_cv<T>::type;
234 template <
typename T>
struct add_cv
236 typedef typename add_volatile<typename add_const<T>::type>::type type;
239 #if ETL_CPP14_SUPPORTED
240 template <
typename T>
241 using add_cv_t =
typename add_cv<T>::type;
246 template <
typename T>
struct is_integral :
false_type {};
264 #if ETL_CPP17_SUPPORTED
265 template <
typename T>
273 template <> struct is_signed<wchar_t> : public etl::integral_constant<bool, static_cast<bool>(wchar_t(-1) < wchar_t(0))> {};
274 template <> struct is_signed<signed char> : true_type {};
275 template <> struct is_signed<short> : true_type {};
276 template <> struct is_signed<int> : true_type {};
277 template <> struct is_signed<long> : true_type {};
278 template <> struct is_signed<long long> : true_type {};
279 template <> struct is_signed<float> : true_type {};
280 template <> struct is_signed<double> : true_type {};
281 template <> struct is_signed<long double> : true_type {};
282 template <typename T> struct is_signed<const T> : is_signed<T> {};
283 template <typename T> struct is_signed<volatile T> : is_signed<T> {};
284 template <typename T> struct is_signed<const volatile T> : is_signed<T> {};
286 #if ETL_CPP17_SUPPORTED
287 template <typename T>
288 inline constexpr bool is_signed_v = is_signed<T>::value;
293 template <typename T> struct is_unsigned : false_type {};
294 template <> struct is_unsigned<bool> : true_type {};
295 template <> struct is_unsigned<char> : integral_constant<bool, (char(255) > 0)> {};
296 template <> struct is_unsigned<unsigned char> : true_type {};
297 template <> struct is_unsigned<wchar_t> : public etl::integral_constant<bool, (wchar_t(-1) > wchar_t(0))> {};
306 #if ETL_CPP17_SUPPORTED
307 template <
typename T>
321 #if ETL_CPP17_SUPPORTED
322 template <
typename T>
331 #if ETL_CPP17_SUPPORTED
332 template <
typename T1,
typename T2>
341 #if ETL_CPP17_SUPPORTED
342 template <
typename T>
350 #if ETL_CPP17_SUPPORTED
351 template <
typename T>
352 inline constexpr
bool is_arithmetic_v = is_arithmetic<T>::value;
357 template <
typename T>
struct is_fundamental : integral_constant<bool, is_arithmetic<T>::value || is_void<T>::value> {};
359 #if ETL_CPP17_SUPPORTED
360 template <
typename T>
361 inline constexpr
bool is_fundamental_v = is_fundamental<T>::value;
366 template <
typename T>
struct is_compound : integral_constant<bool, !is_fundamental<T>::value> {};
368 #if ETL_CPP17_SUPPORTED
369 template <
typename T>
370 inline constexpr
bool is_compound_v = is_compound<T>::value;
375 template <
typename T>
struct is_array :
false_type {};
379 #if ETL_CPP17_SUPPORTED
380 template <
typename T>
390 #if ETL_CPP17_SUPPORTED
391 template <
typename T>
392 inline constexpr
bool is_pointer_v = is_pointer<T>::value;
401 #if ETL_CPP17_SUPPORTED
402 template <
typename T>
403 inline constexpr
bool is_reference_v = is_reference<T>::value;
412 #if ETL_CPP17_SUPPORTED
413 template <
typename T>
417 #if ETL_CPP11_SUPPORTED
420 template<
typename T>
struct is_rvalue_reference_helper :
false_type {};
421 template<
typename T>
struct is_rvalue_reference_helper<T&&> : true_type {};
422 template<
typename T>
struct is_rvalue_reference : is_rvalue_reference_helper<typename remove_cv<T>::type> {};
424 #if ETL_CPP17_SUPPORTED
425 template <
typename T>
426 inline constexpr
bool is_rvalue_reference_v = etl::is_rvalue_reference<T>::value;
433 template <
typename T>
struct is_pod :
etl::integral_constant<bool, etl::is_fundamental<T>::value || etl::is_pointer<T>::value> {};
435 #if ETL_CPP17_SUPPORTED
436 template <
typename T>
443 template <
typename T>
struct is_trivially_constructible :
etl::is_pod<T> {};
445 #if ETL_CPP17_SUPPORTED
446 template <
typename T>
453 template <
typename T>
struct is_trivially_copy_constructible :
etl::is_pod<T> {};
455 #if ETL_CPP17_SUPPORTED
456 template <
typename T>
463 template <
typename T>
struct is_trivially_destructible :
etl::is_pod<T> {};
465 #if ETL_CPP17_SUPPORTED
466 template <
typename T>
473 template <
typename T>
struct is_trivially_copy_assignable :
etl::is_pod<T> {};
475 #if ETL_CPP17_SUPPORTED
476 template <
typename T>
483 template <
typename T>
struct is_trivially_copyable :
etl::is_pod<T> {};
485 #if ETL_CPP17_SUPPORTED
486 template <
typename T>
492 template <
bool B,
typename T,
typename F>
struct conditional {
typedef T type; };
493 template <
typename T,
typename F>
struct conditional<false, T, F> {
typedef F type; };
497 template <
typename T>
struct make_signed {
typedef T type; };
498 template <>
struct make_signed<char> {
typedef signed char type; };
499 template <>
struct make_signed<unsigned char> {
typedef signed char type; };
510 template <>
struct make_signed<unsigned short> {
typedef short type; };
511 template <>
struct make_signed<unsigned int> {
typedef int type; };
512 template <>
struct make_signed<unsigned long> {
typedef long type; };
513 template <>
struct make_signed<unsigned long long> {
typedef long long type; };
516 template <
typename T>
struct make_signed<const volatile T> :
add_const<typename add_volatile<typename make_signed<T>::type>::type> {};
518 #if ETL_CPP14_SUPPORTED
519 template <
typename T>
520 using make_signed_t =
typename make_signed<T>::type;
525 template <
typename T>
struct make_unsigned {
typedef T type; };
527 template <>
struct make_unsigned<signed char> {
typedef unsigned char type; };
541 template <>
struct make_unsigned<long long> {
typedef unsigned long long type; };
544 template <
typename T>
struct make_unsigned<const volatile T> :
add_const<typename add_volatile<typename make_unsigned<T>::type>::type> {};
546 #if ETL_CPP14_SUPPORTED
547 template <
typename T>
548 using make_unsigned_t =
typename make_unsigned<T>::type;
553 template <
bool B,
typename T =
void>
struct enable_if {};
554 template <
typename T>
struct enable_if<true, T> {
typedef T type; };
556 #if ETL_CPP14_SUPPORTED
557 template <
bool B,
typename T =
void>
563 template <
typename T,
size_t MAXN = 0U>
566 template <
typename T>
569 template <
typename T,
size_t MAXN>
572 template <
typename T,
size_t MAXN>
575 template <
typename T,
size_t I,
size_t MAXN>
578 #if ETL_CPP17_SUPPORTED
579 template <
typename T,
size_t N = 0U>
585 template <
typename T>
struct remove_extent {
typedef T type; };
587 template <
typename T,
size_t MAXN>
struct remove_extent<T[MAXN]> {
typedef T type; };
589 #if ETL_CPP14_SUPPORTED
590 template <
typename T>
591 using remove_extent_t =
typename remove_extent<T>::type;
597 template <
typename T>
struct remove_all_extents<T[]> {
typedef typename remove_all_extents<T>::type type; };
598 template <
typename T,
size_t MAXN>
struct remove_all_extents<T[MAXN]> {
typedef typename remove_all_extents<T>::type type; };
600 #if ETL_CPP14_SUPPORTED
601 template <
typename T>
602 using remove_all_extents_t =
typename remove_all_extents<T>::type;
611 #if ETL_CPP17_SUPPORTED
612 template <
typename T>
618 template <
typename T>
621 typedef typename etl::remove_reference<T>::type U;
623 typename etl::remove_extent<U>::type*,
624 typename etl::remove_cv<U>::type>::type type;
627 #if ETL_CPP14_SUPPORTED
628 template <
typename T>
629 using decay_t =
typename decay<T>::type;
634 template<
typename TBase,
641 template<
typename T>
struct dummy {};
642 struct internal: TDerived, dummy<int>{};
644 static TBase* check(TBase*);
645 template<
typename T>
static char check(dummy<T>*);
649 static const bool value = (
sizeof(check((
internal*)0)) ==
sizeof(TBase*));
653 template<
typename TBase,
typename TDerived>
656 static const bool value =
false;
659 #if ETL_CPP17_SUPPORTED
660 template <
typename T1,
typename T2>
666 namespace private_type_traits
668 template <
typename T>
char test(
int T::*);
671 template <
typename T>
dummy test(...);
674 template <
typename T>
677 #if ETL_CPP17_SUPPORTED
678 template <
typename T>
679 inline constexpr
bool is_class_v = is_class<T>::value;
684 template <
typename T>
struct add_lvalue_reference {
typedef T& type; };
691 #if ETL_CPP14_SUPPORTED
692 template <
typename T>
693 using add_lvalue_reference_t =
typename etl::add_lvalue_reference<T>::type;
698 #if ETL_CPP11_SUPPORTED
699 template <
typename T>
struct add_rvalue_reference {
using type = T && ; };
700 template <
typename T>
struct add_rvalue_reference<T&> {
using type = T & ; };
701 template <>
struct add_rvalue_reference<void> {
using type = void; };
702 template <>
struct add_rvalue_reference<const void> {
using type =
const void; };
703 template <>
struct add_rvalue_reference<volatile void> {
using type =
volatile void; };
704 template <>
struct add_rvalue_reference<const volatile void> {
using type =
const volatile void; };
707 #if ETL_CPP14_SUPPORTED
708 template <
typename T>
709 using add_rvalue_reference_t =
typename etl::add_rvalue_reference<T>::type;
714 #if ETL_CPP11_SUPPORTED
715 template <
typename T>
716 typename etl::add_rvalue_reference<T>::type declval() ETL_NOEXCEPT;
721 #if ETL_CPP11_SUPPORTED
722 namespace private_type_traits
727 template <
typename T>
728 auto returnable(
int)->true_type_for<T()>;
731 auto returnable(...)->etl::false_type;
733 template <
typename TFrom,
typename TTo>
734 auto nonvoid_convertible(
int)->true_type_for<decltype(etl::declval<
void(&)(TTo)>()(etl::declval<TFrom>()))
736 template <
typename,
typename>
737 auto nonvoid_convertible(...)->etl::false_type;
740 #if defined(ETL_COMPILER_ARM5)
741 template <
typename TFrom,
typename TTo>
744 template <
typename TFrom,
typename TTo>
745 struct is_convertible :
etl::integral_constant<bool, (decltype(private_type_traits::returnable<TTo>(0))::value &&
746 decltype(private_type_traits::nonvoid_convertible<TFrom, TTo>(0))::value) ||
747 (etl::is_void<TFrom>::value && etl::is_void<TTo>::value)> {};
751 #if ETL_CPP17_SUPPORTED
752 template <
typename TFrom,
typename TTo >
753 inline constexpr
bool is_convertible_v = etl::is_convertible<TFrom, TTo>::value;
759 #if ETL_CPP11_SUPPORTED && !defined(ETL_COMPILER_ARM5)
760 template <
typename T>
struct alignment_of : integral_constant<size_t, alignof(T)> { };
761 #elif defined(ETL_COMPILER_MICROSOFT)
762 template <
typename T>
struct alignment_of : integral_constant<size_t, size_t(__alignof(T))> {};
763 #elif defined(ETL_COMPILER_IAR) || defined(ETL_COMPILER_TI)
764 template <
typename T>
struct alignment_of : integral_constant<size_t, size_t(__ALIGNOF__(T))> {};
766 template <
typename T>
struct alignment_of : integral_constant<size_t, size_t(__alignof__(T))> {};
771 template <>
struct alignment_of<void> : integral_constant <size_t, 0> {};
773 #if ETL_CPP17_SUPPORTED
774 template <
typename T>
787 template <
typename T, const T VALUE>
788 struct integral_constant : std::integral_constant<T, VALUE> {};
792 typedef integral_constant<bool, false>
false_type;
793 typedef integral_constant<bool, true> true_type;
795 #if ETL_CPP17_SUPPORTED
797 using bool_constant = std::bool_constant<B>;
800 struct bool_constant : std::integral_constant<bool, B> { };
806 #if ETL_CPP17_SUPPORTED
807 template <
typename T>
808 struct negation : std::negation<T>
812 template <
typename T>
813 inline constexpr
bool negation_v = std::negation_v<T>;
819 template <
typename T>
struct remove_reference : std::remove_reference<T> {};
821 #if ETL_CPP14_SUPPORTED
822 template <
typename T>
823 using remove_reference_t = std::remove_reference_t<T>;
829 template <
typename T>
struct remove_pointer : std::remove_pointer<T> {};
831 #if ETL_CPP14_SUPPORTED
832 template <
typename T>
833 using remove_pointer_t = std::remove_pointer_t<T>;
839 template <
typename T>
struct add_pointer : std::add_pointer<T> {};
841 #if ETL_CPP14_SUPPORTED
842 template <
typename T>
843 using add_pointer_t = std::add_pointer_t<T>;
849 template <
typename T>
struct is_const : std::is_const<T> {};
851 #if ETL_CPP17_SUPPORTED
852 template <
typename T>
853 inline constexpr
bool is_const_v = std::is_const_v<T>;
859 template <
typename T>
struct remove_const : std::remove_const<T> {};
861 #if ETL_CPP14_SUPPORTED
862 template <
typename T>
863 using remove_const_t = std::remove_const_t<T>;
869 template <
typename T>
struct add_const : std::add_const<T> {};
871 #if ETL_CPP14_SUPPORTED
872 template <
typename T>
873 using add_const_t = std::add_const_t<T>;
879 template <
typename T>
struct is_volatile : std::is_volatile<T> {};
881 #if ETL_CPP17_SUPPORTED
882 template <
typename T>
883 inline constexpr
bool is_volatile_v = std::is_volatile_v<T>;
889 template <
typename T>
struct remove_volatile : std::remove_volatile<T> {};
891 #if ETL_CPP14_SUPPORTED
892 template <
typename T>
893 using remove_volatile_t = std::remove_volatile_t<T>;
899 template <
typename T>
struct add_volatile : std::add_volatile<T> {};
901 #if ETL_CPP14_SUPPORTED
902 template <
typename T>
903 using add_volatile_t = std::add_volatile_t<T>;
909 template <
typename T>
struct remove_cv : std::remove_cv<T> {};
911 #if ETL_CPP14_SUPPORTED
912 template <
typename T>
913 using remove_cv_t = std::remove_cv_t<T>;
919 template <
typename T>
struct add_cv : std::add_cv<T> {};
921 #if ETL_CPP14_SUPPORTED
922 template <
typename T>
923 using add_cv_t = std::add_cv_t<T>;
929 template <
typename T>
struct is_integral : std::is_integral<T> {};
931 #if ETL_CPP17_SUPPORTED
932 template <
typename T>
933 inline constexpr
bool is_integral_v = std::is_integral_v<T>;
939 template <
typename T>
struct is_signed : std::is_signed<T> {};
941 #if ETL_CPP17_SUPPORTED
942 template <
typename T>
943 inline constexpr
bool is_signed_v = std::is_signed_v<T>;
949 template <
typename T>
struct is_unsigned : std::is_unsigned<T> {};
951 #if ETL_CPP17_SUPPORTED
952 template <
typename T>
953 inline constexpr
bool is_unsigned_v = std::is_unsigned_v<T>;
959 template <
typename T>
struct is_floating_point : std::is_floating_point<T> {};
961 #if ETL_CPP17_SUPPORTED
962 template <
typename T>
963 inline constexpr
bool is_floating_point_v = std::is_floating_point_v<T>;
969 template <
typename T1,
typename T2>
struct is_same : std::is_same<T1, T2> {};
971 #if ETL_CPP17_SUPPORTED
972 template <
typename T1,
typename T2>
973 inline constexpr
bool is_same_v = std::is_same_v<T1, T2>;
979 template<
typename T>
struct is_void : std::is_void<T> {};
981 #if ETL_CPP17_SUPPORTED
982 template <
typename T>
983 inline constexpr
bool is_void_v = std::is_void_v<T>;
989 template<
typename T>
struct is_arithmetic : std::is_arithmetic<T> {};
991 #if ETL_CPP17_SUPPORTED
992 template <
typename T>
993 inline constexpr
bool is_arithmetic_v = std::is_arithmetic_v<T>;
999 template <
typename T>
struct is_fundamental : std::is_fundamental<T> {};
1001 #if ETL_CPP17_SUPPORTED
1002 template <
typename T>
1003 inline constexpr
bool is_fundamental_v = std::is_fundamental_v<T>;
1009 template <
typename T>
struct is_compound : std::is_compound<T> {};
1011 #if ETL_CPP17_SUPPORTED
1012 template <
typename T>
1013 inline constexpr
bool is_compound_v = std::is_compound_v<T>;
1019 template <
typename T>
struct is_array : std::is_array<T> {};
1021 #if ETL_CPP17_SUPPORTED
1022 template <
typename T>
1023 inline constexpr
bool is_array_v = std::is_array_v<T>;
1029 template<
typename T>
struct is_pointer : std::is_pointer<T> {};
1031 #if ETL_CPP17_SUPPORTED
1032 template <
typename T>
1033 inline constexpr
bool is_pointer_v = std::is_pointer_v<T>;
1039 template<
typename T>
struct is_reference : std::is_reference<T> {};
1041 #if ETL_CPP17_SUPPORTED
1042 template <
typename T>
1043 inline constexpr
bool is_reference_v = std::is_reference_v<T>;
1049 template<
typename T>
struct is_lvalue_reference : std::is_lvalue_reference<T> {};
1051 #if ETL_CPP17_SUPPORTED
1052 template <
typename T>
1053 inline constexpr
bool is_lvalue_reference_v = std::is_lvalue_reference_v<T>;
1059 #if ETL_CPP11_SUPPORTED
1060 template<
typename T>
struct is_rvalue_reference : std::is_rvalue_reference<T> {};
1062 #if ETL_CPP17_SUPPORTED
1063 template <
typename T>
1064 inline constexpr
bool is_rvalue_reference_v = std::is_rvalue_reference_v<T>;
1071 template <
typename T>
1072 struct is_pod : std::integral_constant<bool, std::is_standard_layout<T>::value && std::is_trivial<T>::value> {};
1074 #if ETL_CPP17_SUPPORTED
1075 template <
typename T>
1076 inline constexpr
bool is_pod_v = std::is_standard_layout_v<T> && std::is_trivial_v<T>;
1079 #if defined(ETL_COMPILER_GCC)
1080 #if ETL_COMPILER_VERSION >= 5
1081 #define ETL_GCC_V5_TYPE_TRAITS_SUPPORTED
1085 #if !defined(ARDUINO) && ETL_NOT_USING_STLPORT && defined(ETL_GCC_V5_TYPE_TRAITS_SUPPORTED)
1089 template <
typename T>
struct is_trivially_constructible : std::is_trivially_constructible<T> {};
1091 #if ETL_CPP17_SUPPORTED
1092 template <
typename T>
1093 inline constexpr
bool is_trivially_constructible_v = std::is_trivially_constructible_v<T>;
1099 template <
typename T>
struct is_trivially_copy_constructible : std::is_trivially_copy_constructible<T> {};
1101 #if ETL_CPP17_SUPPORTED
1102 template <
typename T>
1103 inline constexpr
bool is_trivially_copy_constructible_v = std::is_trivially_copy_constructible_v<T>;
1109 template <
typename T>
struct is_trivially_destructible : std::is_trivially_destructible<T> {};
1111 #if ETL_CPP17_SUPPORTED
1112 template <
typename T>
1113 inline constexpr
bool is_trivially_destructible_v = std::is_trivially_destructible_v<T>;
1119 template <
typename T>
struct is_trivially_copy_assignable : std::is_trivially_copy_assignable<T> {};
1121 #if ETL_CPP17_SUPPORTED
1122 template <
typename T>
1123 inline constexpr
bool is_trivially_copy_assignable_v = std::is_trivially_copy_assignable_v<T>;
1129 template <
typename T>
struct is_trivially_copyable : std::is_trivially_copyable<T> {};
1131 #if ETL_CPP17_SUPPORTED
1132 template <
typename T>
1133 inline constexpr
bool is_trivially_copyable_v = std::is_trivially_copyable_v<T>;
1139 template <
typename T>
struct is_trivially_constructible : std::is_pod<T> {};
1141 #if ETL_CPP17_SUPPORTED
1142 template <
typename T>
1143 inline constexpr
bool is_trivially_constructible_v = std::is_pod_v<T>;
1149 template <
typename T>
struct is_trivially_copy_constructible : std::is_pod<T> {};
1151 #if ETL_CPP17_SUPPORTED
1152 template <
typename T>
1153 inline constexpr
bool is_trivially_copy_constructible_v = std::is_pod_v<T>;
1159 template <
typename T>
struct is_trivially_destructible : std::is_pod<T> {};
1161 #if ETL_CPP17_SUPPORTED
1162 template <
typename T>
1163 inline constexpr
bool is_trivially_destructible_v = std::is_pod_v<T>;
1169 template <
typename T>
struct is_trivially_copy_assignable : std::is_pod<T> {};
1171 #if ETL_CPP17_SUPPORTED
1172 template <
typename T>
1173 inline constexpr
bool is_trivially_copy_assignable_v = std::is_pod_v<T>;
1179 template <
typename T>
struct is_trivially_copyable : std::is_pod<T> {};
1181 #if ETL_CPP17_SUPPORTED
1182 template <
typename T>
1183 inline constexpr
bool is_trivially_copyable_v = std::is_pod_v<T>;
1190 template <
bool B,
typename T,
typename F>
struct conditional {
typedef T type; };
1191 template <
typename T,
typename F>
struct conditional<false, T, F> {
typedef F type; };
1196 template <
typename T>
struct make_signed : std::make_signed<T> {};
1198 #if ETL_CPP14_SUPPORTED
1199 template <
typename T>
1200 using make_signed_t = std::make_signed_t<T>;
1206 template <
typename T>
struct make_unsigned : std::make_unsigned<T> {};
1208 #if ETL_CPP14_SUPPORTED
1209 template <
typename T>
1210 using make_unsigned_t = std::make_unsigned_t<T>;
1216 template <
bool B,
typename T =
void>
struct enable_if : std::enable_if<B, T> {};
1218 #if ETL_CPP14_SUPPORTED
1219 template <
bool B,
typename T =
void>
1220 using enable_if_t = std::enable_if_t<B, T>;
1226 template <
typename T,
size_t MAXN = 0U>
1227 struct extent : std::extent<T, MAXN> {};
1229 #if ETL_CPP17_SUPPORTED
1230 template <
typename T,
size_t MAXN = 0U>
1231 inline constexpr
size_t extent_v = std::extent_v<T, MAXN>;
1237 template <
typename T>
struct remove_extent : std::remove_extent<T> { };
1239 #if ETL_CPP14_SUPPORTED
1240 template <
typename T>
1241 using remove_extent_t = std::remove_extent_t<T>;
1247 template <
typename T>
struct remove_all_extents : std::remove_all_extents<T> { };
1249 #if ETL_CPP14_SUPPORTED
1250 template <
typename T>
1251 using remove_all_extents_t = std::remove_all_extents_t<T>;
1257 template <
typename T>
struct rank : std::rank<T> {};
1259 #if ETL_CPP17_SUPPORTED
1260 template <
typename T>
1261 inline constexpr
size_t rank_v = std::rank_v<T>;
1267 template <
typename T>
struct decay : std::decay<T> {};
1269 #if ETL_CPP14_SUPPORTED
1270 template <
typename T>
1271 using decay_t = std::decay_t<T>;
1277 template<
typename TBase,
typename TDerived>
struct is_base_of : std::is_base_of<TBase, TDerived> {};
1279 #if ETL_CPP17_SUPPORTED
1280 template <
typename TBase,
typename TDerived>
1281 inline constexpr
bool is_base_of_v = std::is_base_of_v<TBase, TDerived>;
1286 template <
typename T>
struct is_class : std::is_class<T>{};
1288 #if ETL_CPP17_SUPPORTED
1289 template <
typename T>
1290 inline constexpr
bool is_class_v = is_class<T>::value;
1295 template <
typename T>
struct add_lvalue_reference : std::add_lvalue_reference<T> {};
1297 #if ETL_CPP14_SUPPORTED
1298 template <
typename T>
1299 using add_lvalue_reference_t = std::add_lvalue_reference_t<T>;
1304 #if ETL_CPP11_SUPPORTED
1305 template <
typename T>
struct add_rvalue_reference : std::add_rvalue_reference<T> {};
1308 #if ETL_CPP14_SUPPORTED
1309 template <
typename T>
1310 using add_rvalue_reference_t = std::add_rvalue_reference_t<T>;
1315 #if ETL_CPP11_SUPPORTED
1316 template <
typename T>
1317 typename std::add_rvalue_reference<T>::type declval() ETL_NOEXCEPT;
1323 #if ETL_CPP11_SUPPORTED
1324 template <
typename TFrom,
typename TTo>
1325 struct is_convertible : std::is_convertible<TFrom, TTo> {};
1328 #if ETL_CPP17_SUPPORTED
1329 template <
typename TFrom,
typename TTo>
1330 inline constexpr
bool is_convertible_v = std::is_convertible_v<TFrom, TTo>;
1336 template <
typename T>
struct alignment_of : std::alignment_of<T> {};
1337 template <>
struct alignment_of<void> : std::integral_constant<size_t, 0> {};
1339 #if ETL_CPP17_SUPPORTED
1340 template <
typename T>
1341 inline constexpr
size_t alignment_of_v = std::alignment_of_v<T>;
1353 template <
bool B,
typename T, T TRUE_VALUE, T FALSE_VALUE>
1354 struct conditional_integral_constant;
1356 template <
typename T, T TRUE_VALUE, T FALSE_VALUE>
1357 struct conditional_integral_constant<true, T, TRUE_VALUE, FALSE_VALUE>
1360 static const T value = TRUE_VALUE;
1363 template <
typename T, T TRUE_VALUE, T FALSE_VALUE>
1364 struct conditional_integral_constant<false, T, TRUE_VALUE, FALSE_VALUE>
1367 static const T value = FALSE_VALUE;
1371 #if ETL_CPP11_SUPPORTED
1375 template <
typename T,
typename T1,
typename... TRest>
1382 template <
typename T,
typename T1>
1383 struct is_one_of<T, T1>
1391 template <
typename T,
1392 typename T1,
typename T2 = void,
typename T3 = void,
typename T4 = void,
1393 typename T5 = void,
typename T6 = void,
typename T7 = void,
typename T8 = void,
1394 typename T9 = void,
typename T10 = void,
typename T11 = void,
typename T12 = void,
1395 typename T13 = void,
typename T14 = void,
typename T15 = void,
typename T16 =
void>
1398 static const bool value =
1418 #if ETL_CPP17_SUPPORTED
1419 template <
typename T,
typename... TRest>
1420 inline constexpr
bool is_one_of_v =
etl::is_one_of<T, TRest...>::value;
1428 template <
typename T>
1437 typedef type_t type;
1438 typedef type_t& reference;
1439 typedef const type_t& const_reference;
1440 typedef type_t* pointer;
1441 typedef const type_t* const_pointer;
1442 typedef const type_t*
const const_pointer_const;
1444 #if ETL_CPP11_SUPPORTED
1445 typedef type_t&& rvalue_reference;
1450 template <
typename T>
1459 typedef type_t type;
1460 typedef type_t& reference;
1461 typedef const type_t& const_reference;
1462 typedef type_t* pointer;
1463 typedef const type_t* const_pointer;
1464 typedef const type_t*
const const_pointer_const;
1466 #if ETL_CPP11_SUPPORTED
1467 typedef type_t&& rvalue_reference;
1472 template <
typename T>
1473 struct types<T*
const>
1481 typedef type_t type;
1482 typedef type_t& reference;
1483 typedef const type_t& const_reference;
1484 typedef type_t* pointer;
1485 typedef const type_t* const_pointer;
1486 typedef const type_t*
const const_pointer_const;
1488 #if ETL_CPP11_SUPPORTED
1489 typedef type_t&& rvalue_reference;
1494 template <
typename T>
1503 typedef type_t type;
1504 typedef type_t& reference;
1505 typedef const type_t& const_reference;
1506 typedef type_t* pointer;
1507 typedef const type_t* const_pointer;
1508 typedef const type_t*
const const_pointer_const;
1510 #if ETL_CPP11_SUPPORTED
1511 typedef type_t&& rvalue_reference;
1515 #if ETL_CPP11_SUPPORTED
1517 template <
typename T>
1526 typedef type_t type;
1527 typedef type_t& reference;
1528 typedef const type_t& const_reference;
1529 typedef type_t* pointer;
1530 typedef const type_t* const_pointer;
1531 typedef const type_t*
const const_pointer_const;
1533 #if ETL_CPP11_SUPPORTED
1534 typedef type_t&& rvalue_reference;
1539 #if ETL_CPP11_SUPPORTED
1540 template <
typename T>
1541 using types_t =
typename types<T>::type;
1543 template <
typename T>
1544 using types_r =
typename types<T>::reference;
1546 template <
typename T>
1547 using types_cr =
typename types<T>::const_reference;
1549 template <
typename T>
1550 using types_rr =
typename types<T>::rvalue_reference;
1552 template <
typename T>
1553 using types_p =
typename types<T>::pointer;
1555 template <
typename T>
1556 using types_cp =
typename types<T>::const_pointer;
1558 template <
typename T>
1559 using types_cpc =
typename types<T>::const_pointer_const;
1568 #if ETL_CPP17_SUPPORTED
1569 template <
typename T>
1573 #if ETL_CPP11_SUPPORTED
1576 template <
typename T,
typename T1,
typename... TRest>
1580 etl::are_all_same<T, TRest...>::value;
1583 template <
typename T,
typename T1>
1584 struct are_all_same<T, T1>
1590 #if ETL_CPP17_SUPPORTED
1591 template <
typename T,
typename T1,
typename... TRest>
1592 inline constexpr
bool are_all_same_v = are_all_same<T, T1, TRest...>::value;
Definition: constant.h:45
integral_constant< bool, false > false_type
integral_constant specialisations
Definition: type_traits_generator.h:804
add_const
Definition: type_traits_generator.h:881
add_pointer
Definition: type_traits_generator.h:851
add_volatile
Definition: type_traits_generator.h:911
add_rvalue_reference
Definition: type_traits_generator.h:1348
conditional
Definition: type_traits_generator.h:1202
decay
Definition: type_traits_generator.h:1279
enable_if
Definition: type_traits_generator.h:1228
extent
Definition: type_traits_generator.h:1239
integral_constant
Definition: type_traits_generator.h:800
is_arithmetic
Definition: type_traits_generator.h:1001
is_array
Definition: type_traits_generator.h:1031
is_base_of
Definition: type_traits_generator.h:1289
is_const
Definition: type_traits_generator.h:861
is_floating_point
Definition: type_traits_generator.h:971
is_fundamental
Definition: type_traits_generator.h:1011
is_integral
Definition: type_traits_generator.h:941
is_lvalue_reference
Definition: type_traits_generator.h:1061
is_rvalue_reference
Definition: type_traits_generator.h:1084
is_pointer
Definition: type_traits_generator.h:1041
is_reference
Definition: type_traits_generator.h:1051
is_same
Definition: type_traits_generator.h:981
is_signed
Definition: type_traits_generator.h:951
is_trivially_constructible
Definition: type_traits_generator.h:1151
is_trivially_copy_assignable
Definition: type_traits_generator.h:1181
is_trivially_copy_constructible
Definition: type_traits_generator.h:1161
is_trivially_copyable
Definition: type_traits_generator.h:1191
is_trivially_destructible
Definition: type_traits_generator.h:1171
is_unsigned
Definition: type_traits_generator.h:961
is_void
Definition: type_traits_generator.h:991
is_volatile
Definition: type_traits_generator.h:891
make_signed
Definition: type_traits_generator.h:1208
make_unsigned
Definition: type_traits_generator.h:1218
rank
Definition: type_traits_generator.h:1269
remove_all_extents
Definition: type_traits_generator.h:1259
remove_const
Definition: type_traits_generator.h:871
remove_cv
Definition: type_traits_generator.h:921
remove_extent
Definition: type_traits_generator.h:1249
remove_pointer
Definition: type_traits_generator.h:841
negation
Definition: type_traits_generator.h:831
remove_volatile
Definition: type_traits_generator.h:901
Definition: absolute.h:37
Definition: type_traits.h:685
Definition: type_traits.h:687
Definition: type_traits.h:689
Definition: type_traits.h:686
Definition: type_traits.h:688
Definition: type_traits_generator.h:812
Definition: type_traits.h:655
is_class
Definition: type_traits_generator.h:1298
is_lvalue_reference
Definition: type_traits.h:408
Definition: type_traits.h:1397
is_pointer
Definition: type_traits.h:386
is_reference
Definition: type_traits.h:397
negation
Definition: type_traits.h:114
Definition: type_traits.h:670
size_of
Definition: type_traits_generator.h:1572
A set of templates to allow related types to be derived.
Definition: type_traits_generator.h:1437
void add_pointer(const volatile void *value, TIString &str, const etl::basic_format_spec< TIString > &format, bool append)
Helper function for pointers.
Definition: to_string_helper.h:326