32#error THIS HEADER IS A GENERATOR. DO NOT INCLUDE.
53#ifndef ETL_TYPE_TRAITS_INCLUDED
54#define ETL_TYPE_TRAITS_INCLUDED
58#include "static_assert.h"
68#if ETL_USING_STL && ETL_USING_CPP11
69 #include <type_traits>
75 template <
typename...>
79#if ETL_NOT_USING_STL || ETL_CPP11_NOT_SUPPORTED
87 template <
typename T, T VALUE>
88 struct integral_constant
90 static const T value =
VALUE;
95 operator value_type()
const
105 template <
typename T, T VALUE>
106 const T integral_constant<T, VALUE>::value;
109 template <
typename T, T VALUE>
114 template <
bool BValue>
115 using bool_constant = integral_constant<bool, BValue>;
117 template <
bool BValue>
122 template <
bool BValue>
128 template <
typename T>
134 template <
typename T>
135 inline constexpr bool negation_v = negation<T>::value;
140 template <
typename T>
struct remove_reference {
typedef T type; };
147 template <
typename T>
153 template <
typename T>
struct remove_pointer {
typedef T type; };
164 template <
typename T>
170 template <
typename T>
struct add_pointer {
typedef typename remove_reference<T>::type* type; };
173 template <
typename T>
179 template <
typename T>
struct is_const :
false_type {};
184 template <
typename T>
190 template <
typename T>
struct remove_const {
typedef T type; };
194 template <
typename T>
200 template <
typename T>
struct add_const {
typedef const T type; };
204 template <
typename T>
215 template <
typename T>
225 template <
typename T>
231 template <
typename T>
struct add_volatile {
typedef volatile T type; };
235 template <
typename T>
247 template <
typename T>
253 template <
typename T>
struct add_cv
259 template <
typename T>
260 using add_cv_t =
typename add_cv<T>::type;
265 template <
typename T>
struct remove_cvref
271 template <
typename T>
277 template <
typename T>
struct is_integral :
false_type {};
291#if ETL_HAS_NATIVE_CHAR8_T
294#if ETL_HAS_NATIVE_CHAR16_T
295 template <>
struct is_integral<char16_t> : true_type {};
297#if ETL_HAS_NATIVE_CHAR32_T
298 template <>
struct is_integral<char32_t> : true_type {};
305 template <
typename T>
313 template <> struct is_signed<wchar_t> : public etl::bool_constant<wchar_t(-1) < wchar_t(0)> {};
314 template <> struct is_signed<signed char> : true_type {};
315 template <> struct is_signed<short> : true_type {};
316 template <> struct is_signed<int> : true_type {};
317 template <> struct is_signed<long> : true_type {};
318 template <> struct is_signed<long long> : true_type {};
319 template <> struct is_signed<float> : true_type {};
320 template <> struct is_signed<double> : true_type {};
321 template <> struct is_signed<long double> : true_type {};
322#if ETL_HAS_NATIVE_CHAR8_T
323 template <> struct is_signed<char8_t> : true_type {};
325#if ETL_HAS_NATIVE_CHAR16_T
326 template <> struct is_signed<char16_t> : true_type {};
328#if ETL_HAS_NATIVE_CHAR32_T
329 template <> struct is_signed<char32_t> : true_type {};
331 template <typename T> struct is_signed<const T> : is_signed<T> {};
332 template <typename T> struct is_signed<volatile T> : is_signed<T> {};
333 template <typename T> struct is_signed<const volatile T> : is_signed<T> {};
336 template <typename T>
337 inline constexpr bool is_signed_v = is_signed<T>::value;
342 template <typename T> struct is_unsigned : false_type {};
343 template <> struct is_unsigned<bool> : true_type {};
344 template <> struct is_unsigned<char> : etl::bool_constant<(char(255) > 0)> {};
345 template <> struct is_unsigned<unsigned char> : true_type {};
346 template <> struct is_unsigned<wchar_t> : public etl::bool_constant<(wchar_t(-1) > wchar_t(0))> {};
348 template <>
struct is_unsigned<
unsigned int> : true_type {};
349 template <>
struct is_unsigned<
unsigned long> : true_type {};
351 template <
typename T>
struct is_unsigned<
const T> : is_unsigned<T> {};
352 template <
typename T>
struct is_unsigned<
volatile T> : is_unsigned<T> {};
353 template <
typename T>
struct is_unsigned<
const volatile T> : is_unsigned<T> {};
356 template <
typename T>
362 template <
typename T>
struct is_floating_point :
false_type {};
363 template <>
struct is_floating_point<
float> : true_type {};
364 template <>
struct is_floating_point<
double> : true_type {};
365 template <>
struct is_floating_point<
long double> : true_type {};
366 template <
typename T>
struct is_floating_point<
const T> : is_floating_point<T> {};
367 template <
typename T>
struct is_floating_point<
volatile T> : is_floating_point<T> {};
368 template <
typename T>
struct is_floating_point<
const volatile T> : is_floating_point<T> {};
371 template <
typename T>
377 template <
typename T1,
typename T2>
struct is_same :
public false_type {};
378 template <
typename T>
struct is_same<
T,
T> :
public true_type {};
381 template <
typename T1,
typename T2>
382 inline constexpr bool is_same_v = is_same<T1, T2>::value;
387 template<
typename T>
struct is_void :
false_type {};
388 template<>
struct is_void<
void> : true_type {};
391 template <
typename T>
392 inline constexpr bool is_void_v = is_void<T>::value;
397 template<
typename T>
struct is_arithmetic :
etl::bool_constant<is_integral<T>::value || is_floating_point<T>::value> {};
400 template <
typename T>
406 template <
typename T>
struct is_fundamental :
etl::bool_constant<is_arithmetic<T>::value || is_void<T>::value> {};
409 template <
typename T>
415 template <
typename T>
struct is_compound :
etl::bool_constant<!is_fundamental<T>::value> {};
418 template <
typename T>
424 template <
typename T>
struct is_array :
false_type {};
425 template <
typename T>
struct is_array<
T[]> : true_type {};
426 template <
typename T,
size_t Size>
struct is_array<
T[Size]> : true_type {};
429 template <
typename T>
430 inline constexpr bool is_array_v = is_array<T>::value;
440 template<
typename T>
struct is_pointer :
is_pointer_helper<typename remove_cv<T>::type> {};
443 template <
typename T>
444 inline constexpr bool is_pointer_v = is_pointer<T>::value;
454 template <
typename T>
466 template <
typename T>
474 template<
typename T>
struct is_reference : integral_constant<bool,
475 is_lvalue_reference<T>::value
477 || is_rvalue_reference<T>::value
482 template <
typename T>
489 template <
typename T>
struct is_pod :
etl::bool_constant<etl::is_fundamental<T>::value || etl::is_pointer<T>::value> {};
492 template <
typename T>
498 template <
bool BValue,
typename T,
typename F>
struct conditional {
typedef T type; };
499 template <
typename T,
typename F>
struct conditional<false,
T,
F> {
typedef F type; };
502 template <
bool BValue,
typename T,
typename F>
503 using conditional_t =
typename conditional<BValue, T, F>::type;
508 template <
typename T>
struct make_signed {
typedef T type; };
509 template <>
struct make_signed<
char> {
typedef signed char type; };
510 template <>
struct make_signed<
unsigned char> {
typedef signed char type; };
512 template <>
struct make_signed<
wchar_t>
518 void>::type>::type type;
521 template <>
struct make_signed<
unsigned short> {
typedef short type; };
522 template <>
struct make_signed<
unsigned int> {
typedef int type; };
523 template <>
struct make_signed<
unsigned long> {
typedef long type; };
524 template <>
struct make_signed<
unsigned long long> {
typedef long long type; };
525 template <
typename T>
struct make_signed<
const T> : add_const<typename make_signed<T>::type> {};
526 template <
typename T>
struct make_signed<
volatile T> : add_volatile<typename make_signed<T>::type> {};
527 template <
typename T>
struct make_signed<
const volatile T> : add_const<typename add_volatile<typename make_signed<T>::type>::type> {};
530 template <
typename T>
536 template <
typename T>
struct make_unsigned {
typedef T type; };
537 template <>
struct make_unsigned<
char> {
typedef unsigned char type; };
538 template <>
struct make_unsigned<
signed char> {
typedef unsigned char type; };
539 template <>
struct make_unsigned<
short> {
typedef unsigned short type; };
541 template <>
struct make_unsigned<
wchar_t>
547 void>::type>::type type;
550 template <>
struct make_unsigned<
int> {
typedef unsigned int type; };
551 template <>
struct make_unsigned<
long> {
typedef unsigned long type; };
552 template <>
struct make_unsigned<
long long> {
typedef unsigned long long type; };
553 template <
typename T>
struct make_unsigned<
const T> : add_const<typename make_unsigned<T>::type> {};
554 template <
typename T>
struct make_unsigned<
volatile T> : add_volatile<typename make_unsigned<T>::type> {};
555 template <
typename T>
struct make_unsigned<
const volatile T> : add_const<typename add_volatile<typename make_unsigned<T>::type>::type> {};
558 template <
typename T>
564 template <
bool BValue,
typename T =
void>
struct enable_if {};
565 template <
typename T>
struct enable_if<true,
T> {
typedef T type; };
568 template <
bool BValue,
typename T =
void>
569 using enable_if_t =
typename enable_if<BValue, T>::type;
574 template <
typename T,
unsigned Size = 0U>
575 struct extent : integral_constant<size_t, 0U> {};
577 template <
typename T>
578 struct extent<
T[], 0> : integral_constant<size_t, 0U> {};
580 template <
typename T,
unsigned Size>
581 struct extent<
T[], Size> : integral_constant<size_t, extent<T, Size - 1>::value> {};
583 template <
typename T,
unsigned Size>
584 struct extent<
T[Size], 0> : integral_constant<size_t, Size> {};
586 template <
typename T,
unsigned I,
unsigned Size>
587 struct extent<
T[
I], Size> : integral_constant<size_t, extent<T, Size - 1>::value> {};
590 template <
typename T,
unsigned Size = 0U>
591 inline constexpr size_t extent_v = extent<T, Size>::value;
596 template <
typename T>
struct remove_extent {
typedef T type; };
597 template <
typename T>
struct remove_extent<
T[]> {
typedef T type; };
598 template <
typename T,
size_t Size>
struct remove_extent<
T[Size]> {
typedef T type; };
601 template <
typename T>
607 template <
typename T>
struct remove_all_extents {
typedef T type; };
608 template <
typename T>
struct remove_all_extents<
T[]> {
typedef typename remove_all_extents<T>::type type; };
609 template <
typename T,
size_t Size>
struct remove_all_extents<
T[Size]> {
typedef typename remove_all_extents<T>::type type; };
612 template <
typename T>
618 template <
typename T>
struct rank : integral_constant<size_t, 0> {};
619 template <
typename T>
struct rank<
T[]> :
public integral_constant<size_t, rank<T>::value + 1> {};
620 template <
typename T,
size_t Size>
struct rank<
T[Size]> :
public integral_constant<size_t, rank<T>::value + 1> {};
623 template <
typename T>
624 inline constexpr size_t rank_v = rank<T>::value;
629 template <
typename T>
632 typedef typename etl::remove_reference<T>::type
U;
635 typename etl::remove_cv<U>::type>::type type;
639 template <
typename T>
640 using decay_t =
typename decay<T>::type;
645 template<
typename TBase,
653 static char check(...) {
return 0; }
661 template<
typename TBase,
typename TDerived>
664 static const bool value =
false;
668 template <
typename T1,
typename T2>
669 inline constexpr bool is_base_of_v = is_base_of<T1, T2>::value;
674 namespace private_type_traits
676 template <
typename T>
char test(
int T::*);
678 struct dummy {
char c[2]; };
679 template <
typename T> dummy test(...);
682 template <
typename T>
686 template <
typename T>
687 inline constexpr bool is_class_v = is_class<T>::value;
692 template <
typename T>
struct add_lvalue_reference {
typedef T& type; };
700 template <
typename T>
716 template <
typename T>
723 template <
typename T>
724 typename etl::add_rvalue_reference<T>::type
declval() ETL_NOEXCEPT;
733 namespace private_type_traits
736 template <
typename T,
typename =
int>
744 template <
typename T>
751 template <
typename T>
754 !is_class<T>::value &&
755 !is_arithmetic<T>::value &&
756 !is_reference<T>::value>
761 template <
typename T>
762 inline constexpr bool is_enum_v = etl::is_enum<T>::value;
765 namespace private_type_traits
768 template <
typename T>
771 static char test(
int);
772 static double test(...);
774 static const bool value =
sizeof(test(
static_cast<T
>(0))) ==
sizeof(
char);
779 template <
typename T>
782 static const bool value = private_type_traits::is_convertible_to_int<T>::value &&
783 !is_class<T>::value &&
784 !is_arithmetic<T>::value &&
785 !is_reference<T>::value;
793 namespace private_type_traits
798 template <
typename T>
804 template <
typename TFrom,
typename TTo>
807 template <
typename,
typename>
811#if defined(ETL_COMPILER_ARM5)
812 template <
typename TFrom,
typename TTo>
815 template <
typename TFrom,
typename TTo>
817 decltype(private_type_traits::nonvoid_convertible<TFrom, TTo>(0))::value) ||
818 (etl::is_void<TFrom>::value && etl::is_void<TTo>::value)> {};
822 template <
typename TFrom,
typename TTo>
827 static void sink(
TTo)
noexcept;
830 template <
typename F>
838 static ETL_CONSTANT
bool value =
decltype(
test<TFrom>(0))::value;
843 template <
typename TFrom,
typename TTo >
844 inline constexpr bool is_convertible_v = etl::is_convertible<TFrom, TTo>::value;
846 template <
typename TFrom,
typename TTo >
853#if ETL_USING_CPP11 && !defined(ETL_COMPILER_ARM5)
854 template <
typename T>
struct alignment_of : integral_constant<size_t, alignof(T)> { };
855#elif defined(ETL_COMPILER_MICROSOFT)
856 template <
typename T>
struct alignment_of : integral_constant<size_t, size_t(__alignof(T))> {};
857#elif defined(ETL_COMPILER_IAR) || defined(ETL_COMPILER_TI)
858 template <
typename T>
struct alignment_of : integral_constant<size_t, size_t(__ALIGNOF__(T))> {};
860 template <
typename T>
struct alignment_of : integral_constant<size_t, size_t(__alignof__(T))> {};
865 template <>
struct alignment_of<
void> : integral_constant <size_t, 0> {};
866 template <>
struct alignment_of<
const void> : integral_constant <size_t, 0> {};
869 template <
typename T>
882 template <
typename T, T VALUE>
883 struct integral_constant : std::integral_constant<T, VALUE> {};
891 template <
typename T, T VALUE>
896 template <
bool BValue>
897 using bool_constant = std::bool_constant<BValue>;
899 template <
bool BValue>
900 struct bool_constant : std::integral_constant<bool, BValue> { };
904 template <
bool BValue>
912 template <
typename T>
913 using negation = std::negation<T>;
915 template <
typename T>
922 template <
typename T>
923 inline constexpr bool negation_v = std::negation_v<T>;
929 template <
typename T>
struct remove_reference : std::remove_reference<T> {};
932 template <
typename T>
939 template <
typename T>
struct remove_pointer : std::remove_pointer<T> {};
942 template <
typename T>
949 template <
typename T>
struct add_pointer : std::add_pointer<T> {};
952 template <
typename T>
959 template <
typename T>
struct is_const : std::is_const<T> {};
962 template <
typename T>
963 inline constexpr bool is_const_v = std::is_const_v<T>;
969 template <
typename T>
struct remove_const : std::remove_const<T> {};
972 template <
typename T>
979 template <
typename T>
struct add_const : std::add_const<T> {};
982 template <
typename T>
983 using add_const_t =
typename std::add_const<T>::type;
989 template <
typename T>
struct is_volatile : std::is_volatile<T> {};
992 template <
typename T>
999 template <
typename T>
struct remove_volatile : std::remove_volatile<T> {};
1002 template <
typename T>
1009 template <
typename T>
struct add_volatile : std::add_volatile<T> {};
1012 template <
typename T>
1019 template <
typename T>
struct remove_cv : std::remove_cv<T> {};
1022 template <
typename T>
1023 using remove_cv_t =
typename std::remove_cv<T>::type;
1029 template <
typename T>
struct add_cv : std::add_cv<T> {};
1032 template <
typename T>
1033 using add_cv_t =
typename std::add_cv<T>::type;
1039 template <
typename T>
struct remove_cvref
1041 typedef typename std::remove_cv<typename std::remove_reference<T>::type>::type type;
1045 template <
typename T>
1052 template <
typename T>
struct is_integral : std::is_integral<T> {};
1055 template <
typename T>
1056 inline constexpr bool is_integral_v = std::is_integral_v<T>;
1062 template <
typename T>
struct is_signed : std::is_signed<T> {};
1065 template <
typename T>
1066 inline constexpr bool is_signed_v = std::is_signed_v<T>;
1072 template <
typename T>
struct is_unsigned : std::is_unsigned<T> {};
1075 template <
typename T>
1076 inline constexpr bool is_unsigned_v = std::is_unsigned_v<T>;
1082 template <
typename T>
struct is_floating_point : std::is_floating_point<T> {};
1085 template <
typename T>
1092 template <
typename T1,
typename T2>
struct is_same : std::is_same<T1, T2> {};
1095 template <
typename T1,
typename T2>
1096 inline constexpr bool is_same_v = std::is_same_v<T1, T2>;
1102 template<
typename T>
struct is_void : std::is_void<T> {};
1105 template <
typename T>
1106 inline constexpr bool is_void_v = std::is_void_v<T>;
1112 template<
typename T>
struct is_arithmetic : std::is_arithmetic<T> {};
1115 template <
typename T>
1122 template <
typename T>
struct is_fundamental : std::is_fundamental<T> {};
1125 template <
typename T>
1132 template <
typename T>
struct is_compound : std::is_compound<T> {};
1135 template <
typename T>
1136 inline constexpr bool is_compound_v = std::is_compound_v<T>;
1142 template <
typename T>
struct is_array : std::is_array<T> {};
1145 template <
typename T>
1146 inline constexpr bool is_array_v = std::is_array_v<T>;
1152 template<
typename T>
struct is_pointer : std::is_pointer<T> {};
1155 template <
typename T>
1156 inline constexpr bool is_pointer_v = std::is_pointer_v<T>;
1162 template<
typename T>
struct is_reference : std::is_reference<T> {};
1165 template <
typename T>
1172 template<
typename T>
struct is_lvalue_reference : std::is_lvalue_reference<T> {};
1175 template <
typename T>
1186 template <
typename T>
1194 template <
typename T>
1195 struct is_pod : std::integral_constant<bool, std::is_standard_layout<T>::value && std::is_trivial<T>::value> {};
1198 template <
typename T>
1199 inline constexpr bool is_pod_v = std::is_standard_layout_v<T> && std::is_trivial_v<T>;
1202#if defined(ETL_COMPILER_GCC)
1203 #if ETL_COMPILER_VERSION >= 5
1204 #define ETL_GCC_V5_TYPE_TRAITS_SUPPORTED
1211 template <
bool BValue,
typename T,
typename F>
struct conditional {
typedef T type; };
1212 template <
typename T,
typename F>
struct conditional<false,
T,
F> {
typedef F type; };
1215 template <
bool BValue,
typename T,
typename F>
1216 using conditional_t =
typename conditional<BValue, T, F>::type;
1222 template <
typename T>
struct make_signed : std::make_signed<T> {};
1225 template <
typename T>
1232 template <
typename T>
struct make_unsigned : std::make_unsigned<T> {};
1235 template <
typename T>
1242 template <
bool BValue,
typename T =
void>
struct enable_if : std::enable_if<BValue, T> {};
1245 template <
bool BValue,
typename T =
void>
1246 using enable_if_t =
typename std::enable_if<BValue, T>::type;
1252 template <
typename T,
unsigned Size = 0U>
1253 struct extent : std::extent<T, Size> {};
1256 template <
typename T,
unsigned Size = 0U>
1257 inline constexpr size_t extent_v = std::extent_v<T, Size>;
1263 template <
typename T>
struct remove_extent : std::remove_extent<T> { };
1266 template <
typename T>
1273 template <
typename T>
struct remove_all_extents : std::remove_all_extents<T> { };
1276 template <
typename T>
1283 template <
typename T>
struct rank : std::rank<T> {};
1286 template <
typename T>
1287 inline constexpr size_t rank_v = std::rank_v<T>;
1293 template <
typename T>
struct decay : std::decay<T> {};
1296 template <
typename T>
1297 using decay_t =
typename std::decay<T>::type;
1303 template<
typename TBase,
typename TDerived>
struct is_base_of : std::is_base_of<TBase, TDerived> {};
1306 template <
typename TBase,
typename TDerived>
1307 inline constexpr bool is_base_of_v = std::is_base_of_v<TBase, TDerived>;
1312 template <
typename T>
struct is_class : std::is_class<T>{};
1315 template <
typename T>
1316 inline constexpr bool is_class_v = is_class<T>::value;
1321 template <
typename T>
struct add_lvalue_reference : std::add_lvalue_reference<T> {};
1324 template <
typename T>
1335 template <
typename T>
1342 template <
typename T>
1343 typename std::add_rvalue_reference<T>::type
declval() ETL_NOEXCEPT;
1350 template <
typename T>
1351 struct is_enum : std::is_enum<T>
1356 template <
typename T>
1357 inline constexpr bool is_enum_v = etl::is_enum<T>::value;
1366 template <
typename TFrom,
typename TTo>
1370 template <
typename TFrom,
typename TTo>
1375 static void sink(
TTo)
noexcept;
1378 template <
typename F>
1386 static ETL_CONSTANT
bool value =
decltype(
test<TFrom>(0))::value;
1391 template <
typename TFrom,
typename TTo>
1392 inline constexpr bool is_convertible_v = std::is_convertible_v<TFrom, TTo>;
1394 template <
typename TFrom,
typename TTo >
1401 template <
typename T>
struct alignment_of : std::alignment_of<T> {};
1402 template <>
struct alignment_of<
void> : std::integral_constant<size_t, 0> {};
1403 template <>
struct alignment_of<
const void> : std::integral_constant <size_t, 0> {};
1406 template <
typename T>
1420 template <
typename...>
1425 template <
typename T1,
typename...
Tn>
1430 template <
typename T>
1437 template <
typename...
T>
1444 template <
typename...>
1449 template <
typename T1,
typename...
Tn>
1460 template <
typename...
T>
1469 template <
typename...
TTypes>
1472 template <
typename T>
1478 template <
typename T1,
typename T2,
typename...
TRest>
1485 template <
typename...
T>
1492 template <
bool BValue,
typename T, T TRUE_VALUE, T FALSE_VALUE>
1493 struct conditional_integral_constant;
1495 template <
typename T, T TRUE_VALUE, T FALSE_VALUE>
1502 template <
typename T, T TRUE_VALUE, T FALSE_VALUE>
1513 template <
typename T,
typename...
TRest>
1521 template <
typename T,
1528 static const bool value =
1549 template <
typename T,
typename...
TRest>
1554 namespace private_type_traits
1558 template<
typename T,
typename...
TTypes>
1562 template<
typename T>
1568 template<
typename T,
typename THead,
typename...
TTail>
1574 template<
typename T,
typename...
TTypes>
1582 template <
typename T,
typename...
TRest>
1597 template <
typename T,
typename...
TRest>
1613 template <
typename T,
typename...
TRest>
1622 template <
size_t Index,
typename TType>
1625 typedef typename nth_base<
Index - 1U,
typename TType::base_type>::type type;
1628 template <
typename TType>
1629 struct nth_base<0,
TType>
1635 template <
size_t Index,
typename TType>
1636 using nth_base_t =
typename nth_base<Index, TType>::type;
1644 template <
typename T>
1653 typedef type_t type;
1654 typedef type_t& reference;
1655 typedef const type_t& const_reference;
1656 typedef type_t* pointer;
1657 typedef const type_t* const_pointer;
1658 typedef const type_t*
const const_pointer_const;
1666 template <
typename T>
1675 typedef type_t type;
1676 typedef type_t& reference;
1677 typedef const type_t& const_reference;
1678 typedef type_t* pointer;
1679 typedef const type_t* const_pointer;
1680 typedef const type_t*
const const_pointer_const;
1688 template <
typename T>
1689 struct types<
T*
const>
1697 typedef type_t type;
1698 typedef type_t& reference;
1699 typedef const type_t& const_reference;
1700 typedef type_t* pointer;
1701 typedef const type_t* const_pointer;
1702 typedef const type_t*
const const_pointer_const;
1710 template <
typename T>
1719 typedef type_t type;
1720 typedef type_t& reference;
1721 typedef const type_t& const_reference;
1722 typedef type_t* pointer;
1723 typedef const type_t* const_pointer;
1724 typedef const type_t*
const const_pointer_const;
1733 template <
typename T>
1742 typedef type_t type;
1743 typedef type_t& reference;
1744 typedef const type_t& const_reference;
1745 typedef type_t* pointer;
1746 typedef const type_t* const_pointer;
1747 typedef const type_t*
const const_pointer_const;
1756 template <
typename T>
1757 using types_t =
typename types<T>::type;
1759 template <
typename T>
1760 using types_r =
typename types<T>::reference;
1762 template <
typename T>
1763 using types_cr =
typename types<T>::const_reference;
1765 template <
typename T>
1766 using types_rr =
typename types<T>::rvalue_reference;
1768 template <
typename T>
1769 using types_p =
typename types<T>::pointer;
1771 template <
typename T>
1772 using types_cp =
typename types<T>::const_pointer;
1774 template <
typename T>
1775 using types_cpc =
typename types<T>::const_pointer_const;
1785 template <
typename T>
1792 template <
typename T,
typename...
TRest>
1799 template <
typename T,
typename...
TRest>
1804#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))
1812 template<
typename T1,
typename T2>
1813 using is_assignable = std::is_assignable<T1, T2>;
1817 template<
typename T,
typename...
TArgs>
1822 template <
typename T>
1823 using is_copy_constructible = std::is_copy_constructible<T>;
1827 template <
typename T>
1828 using is_move_constructible = std::is_move_constructible<T>;
1832#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
1833 template <
typename T>
1834 using is_trivially_constructible = std::is_trivially_constructible<T>;
1836 template <
typename T>
1842#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
1843 template <
typename T>
1844 using is_trivially_copy_constructible = std::is_trivially_copy_constructible<T>;
1846 template <
typename T>
1852#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
1853 template <
typename T>
1854 using is_trivially_destructible = std::is_trivially_destructible<T>;
1856 template <
typename T>
1862#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
1863 template <
typename T>
1864 using is_trivially_copy_assignable = std::is_trivially_copy_assignable<T>;
1866 template <
typename T>
1872#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
1873 template <
typename T>
1874 using is_trivially_copyable = std::is_trivially_copyable<T>;
1876 template <
typename T>
1880#elif defined(ETL_USE_TYPE_TRAITS_BUILTINS) && !defined(ETL_USER_DEFINED_TYPE_TRAITS)
1888 template<
typename T1,
typename T2>
1889 struct is_assignable
1897 template<
typename T,
typename...
TArgs>
1905 template<
typename T,
typename TArgs =
void>
1913 template<
typename T>
1922 template <
typename T>
1923 struct is_copy_constructible :
public etl::is_constructible<T, typename etl::add_lvalue_reference<const T>::type>
1929 template <
typename T>
1937 template <
typename T,
typename...
TArgs>
1938 struct is_trivially_constructible
1940#if defined(ETL_COMPILER_GCC)
1949 template <
typename T,
typename TArgs =
void>
1950 struct is_trivially_constructible
1952#if defined(ETL_COMPILER_GCC)
1961 template <
typename T>
1962 struct is_trivially_constructible<
T,
void>
1964#if defined(ETL_COMPILER_GCC)
1974 template <
typename T>
1975 struct is_trivially_copy_constructible :
public is_trivially_constructible<T, typename add_lvalue_reference<const T>::type>
1981 template <
typename T>
1982 struct is_trivially_destructible
1984#if defined(ETL_COMPILER_GCC)
1993 template <
typename T>
1994 struct is_trivially_copy_assignable
1996#if defined(ETL_COMPILER_GCC)
2005 template <
typename T>
2006 struct is_trivially_copyable
2008#if defined(ETL_COMPILER_GCC)
2015#elif defined(ETL_USER_DEFINED_TYPE_TRAITS) && !defined(ETL_USE_TYPE_TRAITS_BUILTINS)
2024 template <
typename T1,
2027 struct is_assignable;
2029 template <
typename T1,
typename T2>
2034 template <
typename T1,
typename T2>
2035 struct is_assignable<
T1,
T2, false>;
2043 template <
typename T,
typename...
TArgs>
2048 template <
typename T,
typename...
TArgs>
2051 template <
typename T,
typename...
TArgs>
2060 struct is_copy_constructible;
2062 template <
typename T>
2067 template <
typename T>
2068 struct is_copy_constructible<
T, false>;
2073 struct is_move_constructible;
2075 template <
typename T>
2080 template <
typename T>
2081 struct is_move_constructible<
T, false>;
2086 struct is_trivially_constructible;
2088 template <
typename T>
2093 template <
typename T>
2094 struct is_trivially_constructible<
T, false>;
2099 struct is_trivially_copy_constructible;
2101 template <
typename T>
2102 struct is_trivially_copy_constructible<
T, true> :
public etl::true_type
2106 template <
typename T>
2107 struct is_trivially_copy_constructible<
T, false>;
2112 struct is_trivially_destructible;
2114 template <
typename T>
2119 template <
typename T>
2120 struct is_trivially_destructible<
T, false>;
2125 struct is_trivially_copy_assignable;
2127 template <
typename T>
2132 template <
typename T>
2133 struct is_trivially_copy_assignable<
T, false>;
2138 struct is_trivially_copyable;
2140 template <
typename T>
2145 template <
typename T>
2146 struct is_trivially_copyable<
T, false>;
2157 template <
typename T1,
typename T2>
2158 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)>
2165 namespace private_type_traits
2167 template <
class,
class T,
class...
TArgs>
2170 template <
class T,
class...
TArgs>
2176 template <
class T,
class...
TArgs>
2181 template <
class T>
struct is_copy_constructible :
public is_constructible<T, typename etl::add_lvalue_reference<typename etl::add_const<T>::type>::type>{};
2182 template <>
struct is_copy_constructible<
void> :
public false_type{};
2189 template <
typename T>
struct is_move_constructible:
public is_constructible<T, typename etl::add_rvalue_reference<T>::type>{};
2190 template <>
struct is_move_constructible<
void> :
public false_type{};
2199 template <
typename T>
2200 struct is_copy_constructible :
public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
2206 template <
typename T>
2207 struct is_move_constructible :
public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
2214 template <
typename T>
2215 struct is_trivially_constructible :
public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
2221 template <
typename T>
2222 struct is_trivially_copy_constructible :
public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
2228 template <
typename T>
2229 struct is_trivially_destructible :
public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
2235 template <
typename T>
2236 struct is_trivially_copy_assignable :
public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
2242 template <
typename T>
2243 struct is_trivially_copyable :
public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
2249 template <
typename T1,
typename T2>
2250 struct is_lvalue_assignable :
public etl::is_assignable<typename etl::add_lvalue_reference<T1>::type,
2251 typename etl::add_lvalue_reference<typename etl::add_const<T2>::type>::type>
2258 template<
typename T,
typename =
void>
2261 template<
typename T>
2264 template <
typename T>
2265 struct is_default_constructible :
public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
2272 template <
typename T1,
typename T2>
2275 template <
typename T1,
typename T2>
2278 template<
typename T,
typename...
TArgs>
2281 template<
typename T,
typename...
TArgs>
2284 template<
typename T>
2287 template<
typename T>
2290 template <
typename T>
2293 template <
typename T>
2296 template <
typename T>
2299 template <
typename T>
2302 template <
typename T>
2315 template<
typename...>
2322 template <
typename T>
2329 template <
typename T1,
typename T2>
2332 template <
typename,
typename,
typename =
void>
2337 template <
typename T1,
typename T2>
2343 template <
typename T1,
typename T2,
typename =
void>
2349 template <
typename T1,
typename T2>
2358 template <
typename T1,
typename T2>
2360 :
etl::conditional<etl::is_same<T1, typename etl::decay<T1>::type>::value&& etl::is_same<T2, typename etl::decay<T2>::type>::value,
2361 private_common_type::common_type_2_impl<T1, T2>,
2362 common_type<typename etl::decay<T2>::type,
2363 typename etl::decay<T2>::type>>::type
2376 template <
typename T1,
typename T2,
typename...
TRest>
2378 :
common_type<typename common_type<T1, T2>::type, TRest...>
2383 template<
typename T1,
typename T2,
typename...
TRest>
2385 : private_common_type::common_type_multi_impl<void, T1, T2, TRest...>
2389 template <
typename...
T>
2396 template <
typename T>
2397 struct unsigned_type
2403 unsigned long long>::type>::type>::type>::type type;
2407 template <
typename T>
2414 template <
typename T>
2421 long long>::type>::type>::type>::type type;
2425 template <
typename T>
2432 template <
typename T>
2433 struct type_identity {
typedef T type; };
2436 template <
typename T>
2442#if ETL_USING_BUILTIN_UNDERLYING_TYPE
2445 struct underlying_type;
2448 template <
typename T>
2449 struct underlying_type<
T, false>
2452 ETL_STATIC_ASSERT(etl::is_enum<T>::value,
"etl::underlying_type can only be used with enumeration types.");
2455 template <
typename T>
2456 struct underlying_type<
T, true>
2463 template <
typename T>
2464 struct underlying_type
2471 template <
typename T>
2478 template <
typename...
TTypes>
2484 has_duplicates<TRest...>> {};
2486 template <
typename T>
2494 template <
typename...
TTypes>
2501 template <
typename T,
typename...
TTypes>
2504 template <
typename T,
typename U,
typename...
URest>
2506 etl::is_same<T, U>::value +
2507 count_of<T, URest...>::value> {};
2509 template <
typename T>
2514 template <
typename T,
typename...
TTypes>
2521 template <
typename T,
template <
typename...>
class Template>
2524 template <
template <
typename...>
class Template,
typename...
TArgs>
2529 template <
typename T,
template <
typename...>
class Template>
2535 ETL_CONSTEXPR
inline bool is_constant_evaluated() ETL_NOEXCEPT
2546#elif ETL_USING_BUILTIN_IS_CONSTANT_EVALUATED == 1
2559 template<
typename T>
2591#if ETL_HAS_NOEXCEPT_FUNCTION_TYPE
2619 template <
typename T>
2620 inline constexpr bool is_function_v = etl::is_function<T>::value;
2628 template <
typename T, etl::enable_if_t<etl::is_
class<etl::decay_t<T>>::value,
int> = 0>
2631 template <
typename U>
2632 static auto test(
int) ->
decltype(&U::operator(),
etl::true_type());
2641 template <
typename T>
2650 template <
typename T, etl::enable_if_t<etl::is_
class<etl::decay_t<T>>::value,
int> = 0>
2656 template <
typename U>
2657 static auto test(
int) ->
decltype(&U::operator(),
etl::true_type());
2672 template <
typename T>
2680 namespace private_type_traits
2682 template<
typename T>
2685 template<
typename T,
typename TObject>
2689 template<
typename T>
2690 struct is_member_pointer : private_type_traits::is_member_pointer_helper<typename etl::remove_cv<T>::type> {};
2693 template <
typename T>
2708#if ETL_HAS_NOEXCEPT_FUNCTION_TYPE
2725#if ETL_HAS_NOEXCEPT_FUNCTION_TYPE
2742#if ETL_HAS_NOEXCEPT_FUNCTION_TYPE
2758#if ETL_HAS_NOEXCEPT_FUNCTION_TYPE
2772 template <
typename T>
2780 namespace private_type_traits
2785 template<
typename T,
typename TObject>
2789 template<
typename T>
struct is_member_object_pointer :
public private_type_traits::is_member_object_pointer_helper<etl::remove_cv_t<T>>::type {};
2793 template <
typename T>
2799#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)
2800#define ETL_IS_NOT_CHAR_TYPE(type) (!ETL_IS_CHAR_TYPE(type))
2802#define ETL_IS_POINTER_TYPE(type) (etl::is_pointer<type>::value)
2803#define ETL_IS_NOT_POINTER_TYPE(type) (!ETL_IS_POINTER_TYPE(type))
2805#define ETL_TARGET_IS_TRIVIALLY_COPYABLE(type) (etl::is_trivially_copyable<typename etl::iterator_traits<type>::value_type>::value)
2806#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:899
add_const
Definition type_traits_generator.h:991
add_pointer
Definition type_traits_generator.h:961
add_volatile
Definition type_traits_generator.h:1021
add_rvalue_reference
Definition type_traits_generator.h:1413
conditional
Definition type_traits_generator.h:1223
decay
Definition type_traits_generator.h:1305
integral_constant
Definition type_traits_generator.h:895
is_arithmetic
Definition type_traits_generator.h:1124
is_array
Definition type_traits_generator.h:1154
is_const
Definition type_traits_generator.h:971
is_fundamental
Definition type_traits_generator.h:1134
is_integral
Definition type_traits_generator.h:1064
is_lvalue_reference
Definition type_traits_generator.h:1184
is_rvalue_reference
Definition type_traits_generator.h:1207
is_pointer
Definition type_traits_generator.h:1164
is_same
Definition type_traits_generator.h:1104
is_signed
Definition type_traits_generator.h:1074
is_unsigned
Definition type_traits_generator.h:1084
is_volatile
Definition type_traits_generator.h:1001
negation
Definition type_traits_generator.h:929
remove_const
Definition type_traits_generator.h:981
remove_cv
Definition type_traits_generator.h:1031
remove_extent
Definition type_traits_generator.h:1275
remove_pointer
Definition type_traits_generator.h:951
remove_reference
Definition type_traits_generator.h:941
remove_volatile
Definition type_traits_generator.h:1011
bitset_ext
Definition absolute.h:39
ETL_NODISCARD ETL_CONSTEXPR14 T round_half_even_unscaled(T value) ETL_NOEXCEPT
Definition scaled_rounding.h:315
add_lvalue_reference
Definition type_traits_generator.h:1333
Definition type_traits_generator.h:912
Definition type_traits_generator.h:2166
Definition type_traits_generator.h:2208
Definition type_traits_generator.h:2273
Definition type_traits_generator.h:2259
Definition type_traits_generator.h:2697
Definition type_traits_generator.h:2215
Definition type_traits_generator.h:2223
Definition type_traits_generator.h:2244
Definition type_traits_generator.h:2230
Definition type_traits_generator.h:2251
Definition type_traits_generator.h:2237
size_of
Definition type_traits_generator.h:1788
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