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;
107 operator value_type()
const
117 template <
typename T, T VALUE>
118 const T integral_constant<T, VALUE>::value;
121 template <
typename T, T VALUE>
126 template <
bool BValue>
127 using bool_constant = integral_constant<bool, BValue>;
129 template <
bool BValue>
134 template <
bool BValue>
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>
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>
182 template <
typename T>
struct add_pointer {
typedef typename remove_reference<T>::type* type; };
185 template <
typename T>
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>
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>
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>
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>
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>
253 template <
typename T>
struct remove_cv
259 template <
typename T>
265 template <
typename T>
struct add_cv
271 template <
typename T>
272 using add_cv_t =
typename add_cv<T>::type;
277 template <
typename T>
struct remove_cvref
283 template <
typename T>
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 {};
303#if ETL_HAS_NATIVE_CHAR8_T
304 template <>
struct is_integral<char8_t> : true_type {};
306#if ETL_HAS_NATIVE_CHAR16_T
307 template <>
struct is_integral<char16_t> : true_type {};
309#if ETL_HAS_NATIVE_CHAR32_T
310 template <>
struct is_integral<char32_t> : true_type {};
312 template <
typename T>
struct is_integral<
const T> : is_integral<T> {};
313 template <
typename T>
struct is_integral<
volatile T> : is_integral<T> {};
314 template <
typename T>
struct is_integral<
const volatile T> : is_integral<T> {};
317 template <
typename T>
323 template <
typename T>
struct is_signed :
false_type {};
325 template <> struct is_signed<wchar_t> : public etl::bool_constant<wchar_t(-1) < wchar_t(0)> {};
326 template <> struct is_signed<signed char> : true_type {};
327 template <> struct is_signed<short> : true_type {};
328 template <> struct is_signed<int> : true_type {};
329 template <> struct is_signed<long> : true_type {};
330 template <> struct is_signed<long long> : true_type {};
331 template <> struct is_signed<float> : true_type {};
332 template <> struct is_signed<double> : true_type {};
333 template <> struct is_signed<long double> : true_type {};
334#if ETL_HAS_NATIVE_CHAR8_T
335 template <> struct is_signed<char8_t> : true_type {};
337#if ETL_HAS_NATIVE_CHAR16_T
338 template <> struct is_signed<char16_t> : true_type {};
340#if ETL_HAS_NATIVE_CHAR32_T
341 template <> struct is_signed<char32_t> : true_type {};
343 template <typename T> struct is_signed<const T> : is_signed<T> {};
344 template <typename T> struct is_signed<volatile T> : is_signed<T> {};
345 template <typename T> struct is_signed<const volatile T> : is_signed<T> {};
348 template <typename T>
349 inline constexpr bool is_signed_v = is_signed<T>::value;
354 template <typename T> struct is_unsigned : false_type {};
355 template <> struct is_unsigned<bool> : true_type {};
356 template <> struct is_unsigned<char> : etl::bool_constant<(char(255) > 0)> {};
357 template <> struct is_unsigned<unsigned char> : true_type {};
358 template <> struct is_unsigned<wchar_t> : public etl::bool_constant<(wchar_t(-1) > wchar_t(0))> {};
359 template <>
struct is_unsigned<
unsigned short> : true_type {};
360 template <>
struct is_unsigned<
unsigned int> : true_type {};
361 template <>
struct is_unsigned<
unsigned long> : true_type {};
363 template <
typename T>
struct is_unsigned<
const T> : is_unsigned<T> {};
364 template <
typename T>
struct is_unsigned<
volatile T> : is_unsigned<T> {};
365 template <
typename T>
struct is_unsigned<
const volatile T> : is_unsigned<T> {};
368 template <
typename T>
374 template <
typename T>
struct is_floating_point :
false_type {};
375 template <>
struct is_floating_point<
float> : true_type {};
376 template <>
struct is_floating_point<
double> : true_type {};
377 template <>
struct is_floating_point<
long double> : true_type {};
378 template <
typename T>
struct is_floating_point<
const T> : is_floating_point<T> {};
379 template <
typename T>
struct is_floating_point<
volatile T> : is_floating_point<T> {};
380 template <
typename T>
struct is_floating_point<
const volatile T> : is_floating_point<T> {};
383 template <
typename T>
389 template <
typename T1,
typename T2>
struct is_same :
public false_type {};
390 template <
typename T>
struct is_same<
T,
T> :
public true_type {};
393 template <
typename T1,
typename T2>
394 inline constexpr bool is_same_v = is_same<T1, T2>::value;
399 template<
typename T>
struct is_void :
false_type {};
400 template<>
struct is_void<
void> : true_type {};
403 template <
typename T>
404 inline constexpr bool is_void_v = is_void<T>::value;
409 template<
typename T>
struct is_arithmetic :
etl::bool_constant<is_integral<T>::value || is_floating_point<T>::value> {};
412 template <
typename T>
418 template <
typename T>
struct is_fundamental :
etl::bool_constant<is_arithmetic<T>::value || is_void<T>::value> {};
421 template <
typename T>
427 template <
typename T>
struct is_compound :
etl::bool_constant<!is_fundamental<T>::value> {};
430 template <
typename T>
436 template <
typename T>
struct is_array :
false_type {};
437 template <
typename T>
struct is_array<
T[]> : true_type {};
438 template <
typename T,
size_t Size>
struct is_array<
T[Size]> : true_type {};
441 template <
typename T>
442 inline constexpr bool is_array_v = is_array<T>::value;
452 template<
typename T>
struct is_pointer :
is_pointer_helper<typename remove_cv<T>::type> {};
455 template <
typename T>
456 inline constexpr bool is_pointer_v = is_pointer<T>::value;
466 template <
typename T>
478 template <
typename T>
486 template<
typename T>
struct is_reference : integral_constant<bool,
487 is_lvalue_reference<T>::value
489 || is_rvalue_reference<T>::value
494 template <
typename T>
501 template <
typename T>
struct is_pod :
etl::bool_constant<etl::is_fundamental<T>::value || etl::is_pointer<T>::value> {};
504 template <
typename T>
510 template <
bool BValue,
typename T,
typename F>
struct conditional {
typedef T type; };
511 template <
typename T,
typename F>
struct conditional<false,
T,
F> {
typedef F type; };
514 template <
bool BValue,
typename T,
typename F>
515 using conditional_t =
typename conditional<BValue, T, F>::type;
520 template <
typename T>
struct make_signed {
typedef T type; };
521 template <>
struct make_signed<
char> {
typedef signed char type; };
522 template <>
struct make_signed<
unsigned char> {
typedef signed char type; };
524 template <>
struct make_signed<
wchar_t>
530 void>::type>::type type;
533 template <>
struct make_signed<
unsigned short> {
typedef short type; };
534 template <>
struct make_signed<
unsigned int> {
typedef int type; };
535 template <>
struct make_signed<
unsigned long> {
typedef long type; };
536 template <>
struct make_signed<
unsigned long long> {
typedef long long type; };
537 template <
typename T>
struct make_signed<
const T> : add_const<typename make_signed<T>::type> {};
538 template <
typename T>
struct make_signed<
volatile T> : add_volatile<typename make_signed<T>::type> {};
539 template <
typename T>
struct make_signed<
const volatile T> : add_const<typename add_volatile<typename make_signed<T>::type>::type> {};
542 template <
typename T>
548 template <
typename T>
struct make_unsigned {
typedef T type; };
549 template <>
struct make_unsigned<
char> {
typedef unsigned char type; };
550 template <>
struct make_unsigned<
signed char> {
typedef unsigned char type; };
551 template <>
struct make_unsigned<
short> {
typedef unsigned short type; };
553 template <>
struct make_unsigned<
wchar_t>
559 void>::type>::type type;
562 template <>
struct make_unsigned<
int> {
typedef unsigned int type; };
563 template <>
struct make_unsigned<
long> {
typedef unsigned long type; };
564 template <>
struct make_unsigned<
long long> {
typedef unsigned long long type; };
565 template <
typename T>
struct make_unsigned<
const T> : add_const<typename make_unsigned<T>::type> {};
566 template <
typename T>
struct make_unsigned<
volatile T> : add_volatile<typename make_unsigned<T>::type> {};
567 template <
typename T>
struct make_unsigned<
const volatile T> : add_const<typename add_volatile<typename make_unsigned<T>::type>::type> {};
570 template <
typename T>
576 template <
bool BValue,
typename T =
void>
struct enable_if {};
577 template <
typename T>
struct enable_if<true,
T> {
typedef T type; };
580 template <
bool BValue,
typename T =
void>
581 using enable_if_t =
typename enable_if<BValue, T>::type;
586 template <
typename T,
unsigned Size = 0U>
587 struct extent : integral_constant<size_t, 0U> {};
589 template <
typename T>
590 struct extent<
T[], 0> : integral_constant<size_t, 0U> {};
592 template <
typename T,
unsigned Size>
593 struct extent<
T[], Size> : integral_constant<size_t, extent<T, Size - 1>::value> {};
595 template <
typename T,
unsigned Size>
596 struct extent<
T[Size], 0> : integral_constant<size_t, Size> {};
598 template <
typename T,
unsigned I,
unsigned Size>
599 struct extent<
T[
I], Size> : integral_constant<size_t, extent<T, Size - 1>::value> {};
602 template <
typename T,
unsigned Size = 0U>
603 inline constexpr size_t extent_v = extent<T, Size>::value;
608 template <
typename T>
struct remove_extent {
typedef T type; };
609 template <
typename T>
struct remove_extent<
T[]> {
typedef T type; };
610 template <
typename T,
size_t Size>
struct remove_extent<
T[Size]> {
typedef T type; };
613 template <
typename T>
619 template <
typename T>
struct remove_all_extents {
typedef T type; };
620 template <
typename T>
struct remove_all_extents<
T[]> {
typedef typename remove_all_extents<T>::type type; };
621 template <
typename T,
size_t Size>
struct remove_all_extents<
T[Size]> {
typedef typename remove_all_extents<T>::type type; };
624 template <
typename T>
630 template <
typename T>
struct rank : integral_constant<size_t, 0> {};
631 template <
typename T>
struct rank<
T[]> :
public integral_constant<size_t, rank<T>::value + 1> {};
632 template <
typename T,
size_t Size>
struct rank<
T[Size]> :
public integral_constant<size_t, rank<T>::value + 1> {};
635 template <
typename T>
636 inline constexpr size_t rank_v = rank<T>::value;
641 template <
typename T>
644 typedef typename etl::remove_reference<T>::type
U;
647 typename etl::remove_cv<U>::type>::type type;
651 template <
typename T>
652 using decay_t =
typename decay<T>::type;
657 template<
typename TBase,
665 static char check(...) {
return 0; }
673 template<
typename TBase,
typename TDerived>
676 static const bool value =
false;
680 template <
typename T1,
typename T2>
681 inline constexpr bool is_base_of_v = is_base_of<T1, T2>::value;
686 namespace private_type_traits
688 template <
typename T>
char test(
int T::*);
690 struct dummy {
char c[2]; };
691 template <
typename T> dummy test(...);
694 template <
typename T>
698 template <
typename T>
699 inline constexpr bool is_class_v = is_class<T>::value;
704 template <
typename T>
struct add_lvalue_reference {
typedef T& type; };
712 template <
typename T>
728 template <
typename T>
735 template <
typename T>
736 typename etl::add_rvalue_reference<T>::type
declval() ETL_NOEXCEPT;
745 namespace private_type_traits
748 template <
typename T,
typename =
int>
756 template <
typename T>
763 template <
typename T>
766 !is_class<T>::value &&
767 !is_arithmetic<T>::value &&
768 !is_reference<T>::value>
773 template <
typename T>
774 inline constexpr bool is_enum_v = etl::is_enum<T>::value;
777 namespace private_type_traits
780 template <
typename T>
783 static char test(
int);
784 static double test(...);
786 static const bool value =
sizeof(test(
static_cast<T
>(0))) ==
sizeof(
char);
791 template <
typename T>
794 static const bool value = private_type_traits::is_convertible_to_int<T>::value &&
795 !is_class<T>::value &&
796 !is_arithmetic<T>::value &&
797 !is_reference<T>::value;
805 namespace private_type_traits
810 template <
typename T>
816 template <
typename TFrom,
typename TTo>
819 template <
typename,
typename>
823#if defined(ETL_COMPILER_ARM5)
824 template <
typename TFrom,
typename TTo>
827 template <
typename TFrom,
typename TTo>
829 decltype(private_type_traits::nonvoid_convertible<TFrom, TTo>(0))::value) ||
830 (etl::is_void<TFrom>::value && etl::is_void<TTo>::value)> {};
834 template <
typename TFrom,
typename TTo>
839 static void sink(
TTo)
noexcept;
842 template <
typename F>
850 static ETL_CONSTANT
bool value =
decltype(
test<TFrom>(0))::value;
855 template <
typename TFrom,
typename TTo >
856 inline constexpr bool is_convertible_v = etl::is_convertible<TFrom, TTo>::value;
858 template <
typename TFrom,
typename TTo >
865#if ETL_USING_CPP11 && !defined(ETL_COMPILER_ARM5)
866 template <
typename T>
struct alignment_of : integral_constant<size_t, alignof(T)> { };
867#elif defined(ETL_COMPILER_MICROSOFT)
868 template <
typename T>
struct alignment_of : integral_constant<size_t, size_t(__alignof(T))> {};
869#elif defined(ETL_COMPILER_IAR) || defined(ETL_COMPILER_TI)
870 template <
typename T>
struct alignment_of : integral_constant<size_t, size_t(__ALIGNOF__(T))> {};
872 template <
typename T>
struct alignment_of : integral_constant<size_t, size_t(__alignof__(T))> {};
877 template <>
struct alignment_of<
void> : integral_constant <size_t, 0> {};
878 template <>
struct alignment_of<
const void> : integral_constant <size_t, 0> {};
881 template <
typename T>
894 template <
typename T, T VALUE>
903 template <
typename T, T VALUE>
908 template <
bool BValue>
911 template <
bool BValue>
916 template <
bool BValue>
924 template <
typename T>
927 template <
typename T>
934 template <
typename T>
935 inline constexpr bool negation_v = std::negation_v<T>;
944 template <
typename T>
954 template <
typename T>
961 template <
typename T>
struct add_pointer : std::add_pointer<T> {};
964 template <
typename T>
971 template <
typename T>
struct is_const : std::is_const<T> {};
974 template <
typename T>
975 inline constexpr bool is_const_v = std::is_const_v<T>;
984 template <
typename T>
991 template <
typename T>
struct add_const : std::add_const<T> {};
994 template <
typename T>
995 using add_const_t =
typename std::add_const<T>::type;
1004 template <
typename T>
1005 inline constexpr bool is_volatile_v = std::is_volatile_v<T>;
1014 template <
typename T>
1024 template <
typename T>
1031 template <
typename T>
struct remove_cv : std::remove_cv<T> {};
1034 template <
typename T>
1035 using remove_cv_t =
typename std::remove_cv<T>::type;
1041 template <
typename T>
struct add_cv : std::add_cv<T> {};
1044 template <
typename T>
1045 using add_cv_t =
typename std::add_cv<T>::type;
1053 typedef typename std::remove_cv<typename std::remove_reference<T>::type>::type type;
1057 template <
typename T>
1067 template <
typename T>
1068 inline constexpr bool is_integral_v = std::is_integral_v<T>;
1074 template <
typename T>
struct is_signed : std::is_signed<T> {};
1077 template <
typename T>
1078 inline constexpr bool is_signed_v = std::is_signed_v<T>;
1087 template <
typename T>
1088 inline constexpr bool is_unsigned_v = std::is_unsigned_v<T>;
1097 template <
typename T>
1104 template <
typename T1,
typename T2>
struct is_same : std::is_same<T1, T2> {};
1107 template <
typename T1,
typename T2>
1108 inline constexpr bool is_same_v = std::is_same_v<T1, T2>;
1114 template<
typename T>
struct is_void : std::is_void<T> {};
1117 template <
typename T>
1118 inline constexpr bool is_void_v = std::is_void_v<T>;
1127 template <
typename T>
1137 template <
typename T>
1147 template <
typename T>
1148 inline constexpr bool is_compound_v = std::is_compound_v<T>;
1154 template <
typename T>
struct is_array : std::is_array<T> {};
1157 template <
typename T>
1158 inline constexpr bool is_array_v = std::is_array_v<T>;
1167 template <
typename T>
1168 inline constexpr bool is_pointer_v = std::is_pointer_v<T>;
1177 template <
typename T>
1187 template <
typename T>
1198 template <
typename T>
1206 template <
typename T>
1207 struct is_pod : std::integral_constant<bool, std::is_standard_layout<T>::value && std::is_trivial<T>::value> {};
1210 template <
typename T>
1211 inline constexpr bool is_pod_v = std::is_standard_layout_v<T> && std::is_trivial_v<T>;
1214#if defined(ETL_COMPILER_GCC)
1215 #if ETL_COMPILER_VERSION >= 5
1216 #define ETL_GCC_V5_TYPE_TRAITS_SUPPORTED
1223 template <
bool BValue,
typename T,
typename F>
struct conditional {
typedef T type; };
1224 template <
typename T,
typename F>
struct conditional<false,
T,
F> {
typedef F type; };
1227 template <
bool BValue,
typename T,
typename F>
1228 using conditional_t =
typename conditional<BValue, T, F>::type;
1237 template <
typename T>
1247 template <
typename T>
1254 template <
bool BValue,
typename T =
void>
struct enable_if : std::enable_if<BValue, T> {};
1257 template <
bool BValue,
typename T =
void>
1258 using enable_if_t =
typename std::enable_if<BValue, T>::type;
1264 template <
typename T,
unsigned Size = 0U>
1268 template <
typename T,
unsigned Size = 0U>
1269 inline constexpr size_t extent_v = std::extent_v<T, Size>;
1278 template <
typename T>
1288 template <
typename T>
1295 template <
typename T>
struct rank : std::rank<T> {};
1298 template <
typename T>
1299 inline constexpr size_t rank_v = std::rank_v<T>;
1305 template <
typename T>
struct decay : std::decay<T> {};
1308 template <
typename T>
1309 using decay_t =
typename std::decay<T>::type;
1315 template<
typename TBase,
typename TDerived>
struct is_base_of : std::is_base_of<TBase, TDerived> {};
1318 template <
typename TBase,
typename TDerived>
1319 inline constexpr bool is_base_of_v = std::is_base_of_v<TBase, TDerived>;
1324 template <
typename T>
struct is_class : std::is_class<T>{};
1327 template <
typename T>
1336 template <
typename T>
1347 template <
typename T>
1354 template <
typename T>
1355 typename std::add_rvalue_reference<T>::type
declval() ETL_NOEXCEPT;
1362 template <
typename T>
1363 struct is_enum : std::is_enum<T>
1368 template <
typename T>
1369 inline constexpr bool is_enum_v = etl::is_enum<T>::value;
1378 template <
typename TFrom,
typename TTo>
1382 template <
typename TFrom,
typename TTo>
1387 static void sink(
TTo)
noexcept;
1390 template <
typename F>
1398 static ETL_CONSTANT
bool value =
decltype(
test<TFrom>(0))::value;
1403 template <
typename TFrom,
typename TTo>
1404 inline constexpr bool is_convertible_v = std::is_convertible_v<TFrom, TTo>;
1406 template <
typename TFrom,
typename TTo >
1418 template <
typename T>
1432 template <
typename...>
1437 template <
typename T1,
typename...
Tn>
1442 template <
typename T>
1449 template <
typename...
T>
1456 template <
typename...>
1461 template <
typename T1,
typename...
Tn>
1472 template <
typename...
T>
1481 template <
typename...
TTypes>
1484 template <
typename T>
1490 template <
typename T1,
typename T2,
typename...
TRest>
1497 template <
typename...
T>
1504 template <
bool BValue,
typename T, T TRUE_VALUE, T FALSE_VALUE>
1507 template <
typename T, T TRUE_VALUE, T FALSE_VALUE>
1514 template <
typename T, T TRUE_VALUE, T FALSE_VALUE>
1525 template <
typename T,
typename...
TRest>
1556 template <
typename T,
typename...
TRest>
1561 namespace private_type_traits
1565 template<
typename T,
typename...
TTypes>
1569 template<
typename T>
1575 template<
typename T,
typename THead,
typename...
TTail>
1581 template<
typename T,
typename...
TTypes>
1589 template <
typename T,
typename...
TRest>
1604 template <
typename T,
typename...
TRest>
1620 template <
typename T,
typename...
TRest>
1629 template <
size_t Index,
typename TType>
1632 typedef typename nth_base<
Index - 1U,
typename TType::base_type>::type type;
1635 template <
typename TType>
1642 template <
size_t Index,
typename TType>
1643 using nth_base_t =
typename nth_base<Index, TType>::type;
1651 template <
typename T>
1660 typedef type_t type;
1661 typedef type_t& reference;
1662 typedef const type_t& const_reference;
1663 typedef type_t* pointer;
1664 typedef const type_t* const_pointer;
1665 typedef const type_t*
const const_pointer_const;
1673 template <
typename T>
1682 typedef type_t type;
1683 typedef type_t& reference;
1684 typedef const type_t& const_reference;
1685 typedef type_t* pointer;
1686 typedef const type_t* const_pointer;
1687 typedef const type_t*
const const_pointer_const;
1695 template <
typename T>
1704 typedef type_t type;
1705 typedef type_t& reference;
1706 typedef const type_t& const_reference;
1707 typedef type_t* pointer;
1708 typedef const type_t* const_pointer;
1709 typedef const type_t*
const const_pointer_const;
1717 template <
typename T>
1726 typedef type_t type;
1727 typedef type_t& reference;
1728 typedef const type_t& const_reference;
1729 typedef type_t* pointer;
1730 typedef const type_t* const_pointer;
1731 typedef const type_t*
const const_pointer_const;
1740 template <
typename T>
1749 typedef type_t type;
1750 typedef type_t& reference;
1751 typedef const type_t& const_reference;
1752 typedef type_t* pointer;
1753 typedef const type_t* const_pointer;
1754 typedef const type_t*
const const_pointer_const;
1763 template <
typename T>
1764 using types_t =
typename types<T>::type;
1766 template <
typename T>
1767 using types_r =
typename types<T>::reference;
1769 template <
typename T>
1770 using types_cr =
typename types<T>::const_reference;
1772 template <
typename T>
1773 using types_rr =
typename types<T>::rvalue_reference;
1775 template <
typename T>
1776 using types_p =
typename types<T>::pointer;
1778 template <
typename T>
1779 using types_cp =
typename types<T>::const_pointer;
1781 template <
typename T>
1782 using types_cpc =
typename types<T>::const_pointer_const;
1792 template <
typename T>
1799 template <
typename T,
typename...
TRest>
1806 template <
typename T,
typename...
TRest>
1811#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))
1819 template<
typename T1,
typename T2>
1820 using is_assignable = std::is_assignable<T1, T2>;
1824 template<
typename T,
typename...
TArgs>
1829 template <
typename T>
1830 using is_copy_constructible = std::is_copy_constructible<T>;
1834 template <
typename T>
1835 using is_move_constructible = std::is_move_constructible<T>;
1839#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
1840 template <
typename T>
1841 using is_trivially_constructible = std::is_trivially_constructible<T>;
1843 template <
typename T>
1849#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
1850 template <
typename T>
1851 using is_trivially_copy_constructible = std::is_trivially_copy_constructible<T>;
1853 template <
typename T>
1859#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
1860 template <
typename T>
1861 using is_trivially_destructible = std::is_trivially_destructible<T>;
1863 template <
typename T>
1869#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
1870 template <
typename T>
1871 using is_trivially_copy_assignable = std::is_trivially_copy_assignable<T>;
1873 template <
typename T>
1879#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
1880 template <
typename T>
1881 using is_trivially_copyable = std::is_trivially_copyable<T>;
1883 template <
typename T>
1887#elif defined(ETL_USE_TYPE_TRAITS_BUILTINS) && !defined(ETL_USER_DEFINED_TYPE_TRAITS)
1895 template<
typename T1,
typename T2>
1896 struct is_assignable
1904 template<
typename T,
typename...
TArgs>
1912 template<
typename T,
typename TArgs =
void>
1920 template<
typename T>
1929 template <
typename T>
1930 struct is_copy_constructible :
public etl::is_constructible<T, typename etl::add_lvalue_reference<const T>::type>
1936 template <
typename T>
1944 template <
typename T,
typename...
TArgs>
1945 struct is_trivially_constructible
1947#if defined(ETL_COMPILER_GCC)
1956 template <
typename T,
typename TArgs =
void>
1957 struct is_trivially_constructible
1959#if defined(ETL_COMPILER_GCC)
1968 template <
typename T>
1969 struct is_trivially_constructible<
T,
void>
1971#if defined(ETL_COMPILER_GCC)
1981 template <
typename T>
1982 struct is_trivially_copy_constructible :
public is_trivially_constructible<T, typename add_lvalue_reference<const T>::type>
1988 template <
typename T>
1989 struct is_trivially_destructible
1991#if defined(ETL_COMPILER_GCC)
2000 template <
typename T>
2001 struct is_trivially_copy_assignable
2003#if defined(ETL_COMPILER_GCC)
2012 template <
typename T>
2013 struct is_trivially_copyable
2015#if defined(ETL_COMPILER_GCC)
2022#elif defined(ETL_USER_DEFINED_TYPE_TRAITS) && !defined(ETL_USE_TYPE_TRAITS_BUILTINS)
2031 template <
typename T1,
2034 struct is_assignable;
2036 template <
typename T1,
typename T2>
2041 template <
typename T1,
typename T2>
2042 struct is_assignable<
T1,
T2, false>;
2050 template <
typename T,
typename...
TArgs>
2055 template <
typename T,
typename...
TArgs>
2058 template <
typename T,
typename...
TArgs>
2067 struct is_copy_constructible;
2069 template <
typename T>
2074 template <
typename T>
2075 struct is_copy_constructible<
T, false>;
2080 struct is_move_constructible;
2082 template <
typename T>
2087 template <
typename T>
2088 struct is_move_constructible<
T, false>;
2093 struct is_trivially_constructible;
2095 template <
typename T>
2100 template <
typename T>
2101 struct is_trivially_constructible<
T, false>;
2106 struct is_trivially_copy_constructible;
2108 template <
typename T>
2109 struct is_trivially_copy_constructible<
T, true> :
public etl::true_type
2113 template <
typename T>
2114 struct is_trivially_copy_constructible<
T, false>;
2119 struct is_trivially_destructible;
2121 template <
typename T>
2126 template <
typename T>
2127 struct is_trivially_destructible<
T, false>;
2132 struct is_trivially_copy_assignable;
2134 template <
typename T>
2139 template <
typename T>
2140 struct is_trivially_copy_assignable<
T, false>;
2145 struct is_trivially_copyable;
2147 template <
typename T>
2152 template <
typename T>
2153 struct is_trivially_copyable<
T, false>;
2164 template <
typename T1,
typename T2>
2165 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)>
2172 namespace private_type_traits
2174 template <
class,
class T,
class...
TArgs>
2177 template <
class T,
class...
TArgs>
2183 template <
class T,
class...
TArgs>
2188 template <
class T>
struct is_copy_constructible :
public is_constructible<T, typename etl::add_lvalue_reference<typename etl::add_const<T>::type>::type>{};
2189 template <>
struct is_copy_constructible<
void> :
public false_type{};
2196 template <
typename T>
struct is_move_constructible:
public is_constructible<T, typename etl::add_rvalue_reference<T>::type>{};
2197 template <>
struct is_move_constructible<
void> :
public false_type{};
2206 template <
typename T>
2213 template <
typename T>
2221 template <
typename T>
2228 template <
typename T>
2235 template <
typename T>
2242 template <
typename T>
2249 template <
typename T>
2256 template <
typename T1,
typename T2>
2258 typename etl::add_lvalue_reference<typename etl::add_const<T2>::type>::type>
2265 template<
typename T,
typename =
void>
2268 template<
typename T>
2271 template <
typename T>
2279 template <
typename T1,
typename T2>
2282 template <
typename T1,
typename T2>
2285 template<
typename T,
typename...
TArgs>
2288 template<
typename T,
typename...
TArgs>
2291 template<
typename T>
2294 template<
typename T>
2297 template <
typename T>
2300 template <
typename T>
2303 template <
typename T>
2306 template <
typename T>
2309 template <
typename T>
2322 template<
typename...>
2329 template <
typename T>
2336 template <
typename T1,
typename T2>
2339 template <
typename,
typename,
typename =
void>
2344 template <
typename T1,
typename T2>
2350 template <
typename T1,
typename T2,
typename =
void>
2356 template <
typename T1,
typename T2>
2365 template <
typename T1,
typename T2>
2367 :
etl::conditional<etl::is_same<T1, typename etl::decay<T1>::type>::value&& etl::is_same<T2, typename etl::decay<T2>::type>::value,
2368 private_common_type::common_type_2_impl<T1, T2>,
2369 common_type<typename etl::decay<T2>::type,
2370 typename etl::decay<T2>::type>>::type
2383 template <
typename T1,
typename T2,
typename...
TRest>
2385 :
common_type<typename common_type<T1, T2>::type, TRest...>
2390 template<
typename T1,
typename T2,
typename...
TRest>
2392 : private_common_type::common_type_multi_impl<void, T1, T2, TRest...>
2396 template <
typename...
T>
2403 template <
typename T>
2410 unsigned long long>::type>::type>::type>::type type;
2414 template <
typename T>
2421 template <
typename T>
2428 long long>::type>::type>::type>::type type;
2432 template <
typename T>
2439 template <
typename T>
2443 template <
typename T>
2449#if ETL_USING_BUILTIN_UNDERLYING_TYPE
2455 template <
typename T>
2459 ETL_STATIC_ASSERT(etl::is_enum<T>::value,
"etl::underlying_type can only be used with enumeration types.");
2462 template <
typename T>
2463 struct underlying_type<
T, true>
2470 template <
typename T>
2478 template <
typename T>
2485 template <
typename...
TTypes>
2491 has_duplicates<TRest...>> {};
2493 template <
typename T>
2501 template <
typename...
TTypes>
2508 template <
typename T,
typename...
TTypes>
2511 template <
typename T,
typename U,
typename...
URest>
2513 etl::is_same<T, U>::value +
2514 count_of<T, URest...>::value> {};
2516 template <
typename T>
2521 template <
typename T,
typename...
TTypes>
2528 template <
typename T,
template <
typename...>
class Template>
2531 template <
template <
typename...>
class Template,
typename...
TArgs>
2536 template <
typename T,
template <
typename...>
class Template>
2542 ETL_CONSTEXPR
inline bool is_constant_evaluated() ETL_NOEXCEPT
2553#elif ETL_USING_BUILTIN_IS_CONSTANT_EVALUATED == 1
2566 template<
typename T>
2598#if ETL_HAS_NOEXCEPT_FUNCTION_TYPE
2626 template <
typename T>
2627 inline constexpr bool is_function_v = etl::is_function<T>::value;
2635 template <
typename T, etl::enable_if_t<etl::is_
class<etl::decay_t<T>>::value,
int> = 0>
2638 template <
typename U>
2639 static auto test(
int) ->
decltype(&U::operator(),
etl::true_type());
2648 template <
typename T>
2657 template <
typename T, etl::enable_if_t<etl::is_
class<etl::decay_t<T>>::value,
int> = 0>
2663 template <
typename U>
2664 static auto test(
int) ->
decltype(&U::operator(),
etl::true_type());
2679 template <
typename T>
2687 namespace private_type_traits
2689 template<
typename T>
2692 template<
typename T,
typename TObject>
2696 template<
typename T>
2700 template <
typename T>
2715#if ETL_HAS_NOEXCEPT_FUNCTION_TYPE
2732#if ETL_HAS_NOEXCEPT_FUNCTION_TYPE
2749#if ETL_HAS_NOEXCEPT_FUNCTION_TYPE
2765#if ETL_HAS_NOEXCEPT_FUNCTION_TYPE
2779 template <
typename T>
2787 namespace private_type_traits
2792 template<
typename T,
typename TObject>
2796 template<
typename T>
struct is_member_object_pointer :
public private_type_traits::is_member_object_pointer_helper<etl::remove_cv_t<T>>::type {};
2800 template <
typename T>
2806#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)
2807#define ETL_IS_NOT_CHAR_TYPE(type) (!ETL_IS_CHAR_TYPE(type))
2809#define ETL_IS_POINTER_TYPE(type) (etl::is_pointer<type>::value)
2810#define ETL_IS_NOT_POINTER_TYPE(type) (!ETL_IS_POINTER_TYPE(type))
2812#define ETL_TARGET_IS_TRIVIALLY_COPYABLE(type) (etl::is_trivially_copyable<typename etl::iterator_traits<type>::value_type>::value)
2813#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_cv
Definition type_traits_generator.h:1041
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
enable_if
Definition type_traits_generator.h:1254
extent
Definition type_traits_generator.h:1265
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_base_of
Definition type_traits_generator.h:1315
is_compound
Definition type_traits_generator.h:1144
is_const
Definition type_traits_generator.h:971
is_floating_point
Definition type_traits_generator.h:1094
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_reference
Definition type_traits_generator.h:1174
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_void
Definition type_traits_generator.h:1114
is_volatile
Definition type_traits_generator.h:1001
make_signed
Definition type_traits_generator.h:1234
make_unsigned
Definition type_traits_generator.h:1244
negation
Definition type_traits_generator.h:929
rank
Definition type_traits_generator.h:1295
remove_all_extents
Definition type_traits_generator.h:1285
remove_const
Definition type_traits_generator.h:981
remove_cv
Definition type_traits_generator.h:1031
remove_cvref
Definition type_traits_generator.h:1052
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
exclusive_disjunction
Definition type_traits_generator.h:1505
Definition type_traits_generator.h:2166
is_class
Definition type_traits_generator.h:1324
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
Get the Nth base of a recursively inherited type. Requires that the class has defined 'base_type'.
Definition type_traits_generator.h:1631
Definition type_traits_generator.h:2690
Defines one of five signed types that has the same size as T.
Definition type_traits_generator.h:2423
size_of
Definition type_traits_generator.h:1788
Definition type_traits_generator.h:2440
A set of templates to allow related types to be derived.
Definition type_traits_generator.h:1653
Primary template for etl::underlying_type Users must specialise this template for their enumerations.
Definition type_traits_generator.h:2472
Defines one of five unsigned types that has the same size as T.
Definition type_traits_generator.h:2405
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