36 #error THIS HEADER IS A GENERATOR. DO NOT INCLUDE.
65 #ifndef ETL_TYPE_TRAITS_INCLUDED
66 #define ETL_TYPE_TRAITS_INCLUDED
73 #include "static_assert.h"
80 #if ETL_USING_STL && ETL_CPP11_SUPPORTED
81 #include <type_traits>
86 #if ETL_NOT_USING_STL || ETL_CPP11_NOT_SUPPORTED
93 template <
typename T, const T VALUE>
94 struct integral_constant
96 static const T value = VALUE;
99 typedef integral_constant<T, VALUE> type;
101 operator value_type()
const
108 typedef integral_constant<bool, false>
false_type;
109 typedef integral_constant<bool, true> true_type;
111 template <
typename T, const T VALUE>
112 const T integral_constant<T, VALUE>::value;
114 #if ETL_CPP11_SUPPORTED
116 using bool_constant = integral_constant<bool, B>;
124 template <
typename T>
129 #if ETL_CPP17_SUPPORTED
130 template <
typename T>
131 inline constexpr
bool negation_v = negation<T>::value;
136 template <
typename T>
struct remove_reference {
typedef T type; };
137 template <
typename T>
struct remove_reference<T&> {
typedef T type; };
139 #if ETL_CPP14_SUPPORTED
140 template <
typename T>
141 using remove_reference_t =
typename remove_reference<T>::type;
146 template <
typename T>
struct remove_pointer {
typedef T type; };
147 template <
typename T>
struct remove_pointer<T*> {
typedef T type; };
148 template <
typename T>
struct remove_pointer<const T*> {
typedef const T type; };
149 template <
typename T>
struct remove_pointer<volatile T*> {
typedef volatile T type; };
150 template <
typename T>
struct remove_pointer<const volatile T*> {
typedef const volatile T type; };
151 template <
typename T>
struct remove_pointer<T*
const> {
typedef T type; };
152 template <
typename T>
struct remove_pointer<const T*
const> {
typedef const T type; };
153 template <
typename T>
struct remove_pointer<volatile T*
const> {
typedef volatile T type; };
154 template <
typename T>
struct remove_pointer<const volatile T*
const> {
typedef const volatile T type; };
156 #if ETL_CPP14_SUPPORTED
157 template <
typename T>
158 using remove_pointer_t =
typename remove_pointer<T>::type;
163 template <
typename T>
struct add_pointer {
typedef typename remove_reference<T>::type* type; };
165 #if ETL_CPP14_SUPPORTED
166 template <
typename T>
167 using add_pointer_t =
typename add_pointer<T>::type;
172 template <
typename T>
struct is_const :
false_type {};
173 template <
typename T>
struct is_const<const T> : true_type {};
174 template <
typename T>
struct is_const<const volatile T> : true_type {};
176 #if ETL_CPP17_SUPPORTED
177 template <
typename T>
178 inline constexpr
bool is_const_v = is_const<T>::value;
183 template <
typename T>
struct remove_const {
typedef T type; };
184 template <
typename T>
struct remove_const<const T> {
typedef T type; };
186 #if ETL_CPP14_SUPPORTED
187 template <
typename T>
188 using remove_const_t =
typename remove_const<T>::type;
193 template <
typename T>
struct add_const {
typedef const T type; };
194 template <
typename T>
struct add_const<const T> {
typedef const T type; };
196 #if ETL_CPP14_SUPPORTED
197 template <
typename T>
198 using add_const_t =
typename add_const<T>::type;
203 template <
typename T>
struct is_volatile :
false_type {};
204 template <
typename T>
struct is_volatile<volatile T> : true_type {};
205 template <
typename T>
struct is_volatile<const volatile T> : true_type {};
207 #if ETL_CPP17_SUPPORTED
208 template <
typename T>
209 inline constexpr
bool is_volatile_v = is_volatile<T>::value;
214 template <
typename T>
struct remove_volatile {
typedef T type; };
215 template <
typename T>
struct remove_volatile<volatile T> {
typedef T type; };
217 #if ETL_CPP14_SUPPORTED
218 template <
typename T>
219 using remove_volatile_t =
typename remove_volatile<T>::type;
224 template <
typename T>
struct add_volatile {
typedef volatile T type; };
225 template <
typename T>
struct add_volatile<volatile T> {
typedef volatile T type; };
227 #if ETL_CPP14_SUPPORTED
228 template <
typename T>
229 using add_volatile_t =
typename add_volatile<T>::type;
234 template <
typename T>
struct remove_cv
236 typedef typename remove_volatile<typename remove_const<T>::type>::type type;
239 #if ETL_CPP14_SUPPORTED
240 template <
typename T>
241 using remove_cv_t =
typename remove_cv<T>::type;
246 template <
typename T>
struct add_cv
248 typedef typename add_volatile<typename add_const<T>::type>::type type;
251 #if ETL_CPP14_SUPPORTED
252 template <
typename T>
253 using add_cv_t =
typename add_cv<T>::type;
258 template <
typename T>
struct is_integral :
false_type {};
259 template <>
struct is_integral<bool> : true_type {};
260 template <>
struct is_integral<char> : true_type {};
261 template <>
struct is_integral<unsigned char> : true_type {};
262 template <>
struct is_integral<signed char> : true_type {};
263 template <>
struct is_integral<wchar_t> : true_type {};
264 template <>
struct is_integral<short> : true_type {};
265 template <>
struct is_integral<unsigned short> : true_type {};
266 template <>
struct is_integral<int> : true_type {};
267 template <>
struct is_integral<unsigned int> : true_type {};
268 template <>
struct is_integral<long> : true_type {};
269 template <>
struct is_integral<unsigned long> : true_type {};
270 template <>
struct is_integral<long long> : true_type {};
271 template <>
struct is_integral<unsigned long long> : true_type {};
272 template <
typename T>
struct is_integral<const T> : is_integral<T> {};
273 template <
typename T>
struct is_integral<volatile T> : is_integral<T> {};
274 template <
typename T>
struct is_integral<const volatile T> : is_integral<T> {};
276 #if ETL_CPP17_SUPPORTED
277 template <
typename T>
278 inline constexpr
bool is_integral_v = is_integral<T>::value;
283 template <
typename T>
struct is_signed :
false_type {};
284 template <>
struct is_signed<char> : integral_constant<bool, (char(255) < 0)> {};
285 template <> struct is_signed<wchar_t> : public etl::integral_constant<bool, static_cast<bool>(wchar_t(-1) < wchar_t(0))> {};
286 template <> struct is_signed<signed char> : true_type {};
287 template <> struct is_signed<short> : true_type {};
288 template <> struct is_signed<int> : true_type {};
289 template <> struct is_signed<long> : true_type {};
290 template <> struct is_signed<long long> : true_type {};
291 template <> struct is_signed<float> : true_type {};
292 template <> struct is_signed<double> : true_type {};
293 template <> struct is_signed<long double> : true_type {};
294 template <typename T> struct is_signed<const T> : is_signed<T> {};
295 template <typename T> struct is_signed<volatile T> : is_signed<T> {};
296 template <typename T> struct is_signed<const volatile T> : is_signed<T> {};
298 #if ETL_CPP17_SUPPORTED
299 template <typename T>
300 inline constexpr bool is_signed_v = is_signed<T>::value;
305 template <typename T> struct is_unsigned : false_type {};
306 template <> struct is_unsigned<bool> : true_type {};
307 template <> struct is_unsigned<char> : integral_constant<bool, (char(255) > 0)> {};
308 template <> struct is_unsigned<unsigned char> : true_type {};
309 template <> struct is_unsigned<wchar_t> : public etl::integral_constant<bool, (wchar_t(-1) > wchar_t(0))> {};
310 template <>
struct is_unsigned<unsigned short> : true_type {};
311 template <>
struct is_unsigned<unsigned int> : true_type {};
312 template <>
struct is_unsigned<unsigned long> : true_type {};
313 template <>
struct is_unsigned<unsigned long long> : true_type {};
314 template <
typename T>
struct is_unsigned<const T> : is_unsigned<T> {};
315 template <
typename T>
struct is_unsigned<volatile T> : is_unsigned<T> {};
316 template <
typename T>
struct is_unsigned<const volatile T> : is_unsigned<T> {};
318 #if ETL_CPP17_SUPPORTED
319 template <
typename T>
320 inline constexpr
bool is_unsigned_v = is_unsigned<T>::value;
325 template <
typename T>
struct is_floating_point :
false_type {};
326 template <>
struct is_floating_point<float> : true_type {};
327 template <>
struct is_floating_point<double> : true_type {};
328 template <>
struct is_floating_point<long double> : true_type {};
329 template <
typename T>
struct is_floating_point<const T> : is_floating_point<T> {};
330 template <
typename T>
struct is_floating_point<volatile T> : is_floating_point<T> {};
331 template <
typename T>
struct is_floating_point<const volatile T> : is_floating_point<T> {};
333 #if ETL_CPP17_SUPPORTED
334 template <
typename T>
335 inline constexpr
bool is_floating_point_v = is_floating_point<T>::value;
340 template <
typename T1,
typename T2>
struct is_same :
public false_type {};
341 template <
typename T>
struct is_same<T, T> :
public true_type {};
343 #if ETL_CPP17_SUPPORTED
344 template <
typename T1,
typename T2>
345 inline constexpr
bool is_same_v = is_same<T1, T2>::value;
350 template<
typename T>
struct is_void :
false_type {};
351 template<>
struct is_void<void> : true_type {};
353 #if ETL_CPP17_SUPPORTED
354 template <
typename T>
355 inline constexpr
bool is_void_v = is_void<T>::value;
360 template<
typename T>
struct is_arithmetic : integral_constant<bool, is_integral<T>::value || is_floating_point<T>::value> {};
362 #if ETL_CPP17_SUPPORTED
363 template <
typename T>
364 inline constexpr
bool is_arithmetic_v = is_arithmetic<T>::value;
369 template <
typename T>
struct is_fundamental : integral_constant<bool, is_arithmetic<T>::value || is_void<T>::value> {};
371 #if ETL_CPP17_SUPPORTED
372 template <
typename T>
373 inline constexpr
bool is_fundamental_v = is_fundamental<T>::value;
378 template <
typename T>
struct is_compound : integral_constant<bool, !is_fundamental<T>::value> {};
380 #if ETL_CPP17_SUPPORTED
381 template <
typename T>
382 inline constexpr
bool is_compound_v = is_compound<T>::value;
387 template <
typename T>
struct is_array :
false_type {};
388 template <
typename T>
struct is_array<T[]> : true_type {};
389 template <
typename T,
size_t MAXN>
struct is_array<T[MAXN]> : true_type {};
391 #if ETL_CPP17_SUPPORTED
392 template <
typename T>
393 inline constexpr
bool is_array_v = is_array<T>::value;
398 template<
typename T>
struct is_pointer_helper :
false_type {};
399 template<
typename T>
struct is_pointer_helper<T*> : true_type {};
400 template<
typename T>
struct is_pointer : is_pointer_helper<typename remove_cv<T>::type> {};
402 #if ETL_CPP17_SUPPORTED
403 template <
typename T>
404 inline constexpr
bool is_pointer_v = is_pointer<T>::value;
409 template<
typename T>
struct is_reference_helper :
false_type {};
410 template<
typename T>
struct is_reference_helper<T&> : true_type {};
411 template<
typename T>
struct is_reference : is_reference_helper<typename remove_cv<T>::type> {};
413 #if ETL_CPP17_SUPPORTED
414 template <
typename T>
415 inline constexpr
bool is_reference_v = is_reference<T>::value;
420 template<
typename T>
struct is_lvalue_reference_helper :
false_type {};
421 template<
typename T>
struct is_lvalue_reference_helper<T&> : true_type {};
422 template<
typename T>
struct is_lvalue_reference : is_lvalue_reference_helper<typename remove_cv<T>::type> {};
424 #if ETL_CPP17_SUPPORTED
425 template <
typename T>
429 #if ETL_CPP11_SUPPORTED
432 template<
typename T>
struct is_rvalue_reference_helper :
false_type {};
433 template<
typename T>
struct is_rvalue_reference_helper<T&&> : true_type {};
434 template<
typename T>
struct is_rvalue_reference : is_rvalue_reference_helper<typename remove_cv<T>::type> {};
436 #if ETL_CPP17_SUPPORTED
437 template <
typename T>
438 inline constexpr
bool is_rvalue_reference_v = etl::is_rvalue_reference<T>::value;
445 template <
typename T>
struct is_pod :
etl::integral_constant<bool, etl::is_fundamental<T>::value || etl::is_pointer<T>::value> {};
447 #if ETL_CPP17_SUPPORTED
448 template <
typename T>
455 template <
typename T>
struct is_trivially_constructible :
etl::is_pod<T> {};
457 #if ETL_CPP17_SUPPORTED
458 template <
typename T>
465 template <
typename T>
struct is_trivially_copy_constructible :
etl::is_pod<T> {};
467 #if ETL_CPP17_SUPPORTED
468 template <
typename T>
475 template <
typename T>
struct is_trivially_destructible :
etl::is_pod<T> {};
477 #if ETL_CPP17_SUPPORTED
478 template <
typename T>
485 template <
typename T>
struct is_trivially_copy_assignable :
etl::is_pod<T> {};
487 #if ETL_CPP17_SUPPORTED
488 template <
typename T>
495 template <
typename T>
struct is_trivially_copyable :
etl::is_pod<T> {};
497 #if ETL_CPP17_SUPPORTED
498 template <
typename T>
504 template <
bool B,
typename T,
typename F>
struct conditional {
typedef T type; };
505 template <
typename T,
typename F>
struct conditional<false, T, F> {
typedef F type; };
509 template <
typename T>
struct make_signed {
typedef T type; };
510 template <>
struct make_signed<char> {
typedef signed char type; };
511 template <>
struct make_signed<unsigned char> {
typedef signed char type; };
513 template <>
struct make_signed<wchar_t>
519 void>::type>::type type;
522 template <>
struct make_signed<unsigned short> {
typedef short type; };
523 template <>
struct make_signed<unsigned int> {
typedef int type; };
524 template <>
struct make_signed<unsigned long> {
typedef long type; };
525 template <>
struct make_signed<unsigned long long> {
typedef long long type; };
526 template <
typename T>
struct make_signed<const T> : add_const<typename make_signed<T>::type> {};
527 template <
typename T>
struct make_signed<volatile T> : add_volatile<typename make_signed<T>::type> {};
528 template <
typename T>
struct make_signed<const volatile T> : add_const<typename add_volatile<typename make_signed<T>::type>::type> {};
530 #if ETL_CPP14_SUPPORTED
531 template <
typename T>
532 using make_signed_t =
typename make_signed<T>::type;
537 template <
typename T>
struct make_unsigned {
typedef T type; };
538 template <>
struct make_unsigned<char> {
typedef unsigned char type; };
539 template <>
struct make_unsigned<signed char> {
typedef unsigned char type; };
540 template <>
struct make_unsigned<short> {
typedef unsigned short type; };
542 template <>
struct make_unsigned<wchar_t>
548 void>::type>::type type;
551 template <>
struct make_unsigned<int> {
typedef unsigned int type; };
552 template <>
struct make_unsigned<long> {
typedef unsigned long type; };
553 template <>
struct make_unsigned<long long> {
typedef unsigned long long type; };
554 template <
typename T>
struct make_unsigned<const T> : add_const<typename make_unsigned<T>::type> {};
555 template <
typename T>
struct make_unsigned<volatile T> : add_volatile<typename make_unsigned<T>::type> {};
556 template <
typename T>
struct make_unsigned<const volatile T> : add_const<typename add_volatile<typename make_unsigned<T>::type>::type> {};
558 #if ETL_CPP14_SUPPORTED
559 template <
typename T>
560 using make_unsigned_t =
typename make_unsigned<T>::type;
565 template <
bool B,
typename T =
void>
struct enable_if {};
566 template <
typename T>
struct enable_if<true, T> {
typedef T type; };
568 #if ETL_CPP14_SUPPORTED
569 template <
bool B,
typename T =
void>
570 using enable_if_t =
typename enable_if<B, T>::type;
575 template <
typename T,
size_t MAXN = 0U>
576 struct extent : integral_constant<size_t, 0U> {};
578 template <
typename T>
579 struct extent<T[], 0> : integral_constant<size_t, 0U> {};
581 template <
typename T,
size_t MAXN>
582 struct extent<T[], MAXN> : integral_constant<size_t, extent<T, MAXN - 1>::value> {};
584 template <
typename T,
size_t MAXN>
585 struct extent<T[MAXN], 0> : integral_constant<size_t, MAXN> {};
587 template <
typename T,
size_t I,
size_t MAXN>
588 struct extent<T[I], MAXN> : integral_constant<size_t, extent<T, MAXN - 1>::value> {};
590 #if ETL_CPP17_SUPPORTED
591 template <
typename T,
size_t N = 0U>
592 inline constexpr
size_t extent_v = extent<T, N>::value;
597 template <
typename T>
struct remove_extent {
typedef T type; };
598 template <
typename T>
struct remove_extent<T[]> {
typedef T type; };
599 template <
typename T,
size_t MAXN>
struct remove_extent<T[MAXN]> {
typedef T type; };
601 #if ETL_CPP14_SUPPORTED
602 template <
typename T>
603 using remove_extent_t =
typename remove_extent<T>::type;
608 template <
typename T>
struct remove_all_extents {
typedef T type; };
609 template <
typename T>
struct remove_all_extents<T[]> {
typedef typename remove_all_extents<T>::type type; };
610 template <
typename T,
size_t MAXN>
struct remove_all_extents<T[MAXN]> {
typedef typename remove_all_extents<T>::type type; };
612 #if ETL_CPP14_SUPPORTED
613 template <
typename T>
614 using remove_all_extents_t =
typename remove_all_extents<T>::type;
619 template <
typename T>
struct rank : integral_constant<size_t, 0> {};
620 template <
typename T>
struct rank<T[]> :
public integral_constant<size_t, rank<T>::value + 1> {};
621 template <
typename T,
size_t MAXN>
struct rank<T[MAXN]> :
public integral_constant<size_t, rank<T>::value + 1> {};
623 #if ETL_CPP17_SUPPORTED
624 template <
typename T>
625 inline constexpr
size_t rank_v = rank<T>::value;
630 template <
typename T>
633 typedef typename etl::remove_reference<T>::type U;
635 typename etl::remove_extent<U>::type*,
636 typename etl::remove_cv<U>::type>::type type;
639 #if ETL_CPP14_SUPPORTED
640 template <
typename T>
641 using decay_t =
typename decay<T>::type;
646 template<
typename TBase,
653 template<
typename T>
struct dummy {};
654 struct internal: TDerived, dummy<int>{};
656 static TBase* check(TBase*);
657 template<
typename T>
static char check(dummy<T>*);
661 static const bool value = (
sizeof(check((
internal*)0)) ==
sizeof(TBase*));
665 template<
typename TBase,
typename TDerived>
666 struct is_base_of<TBase, TDerived, true>
668 static const bool value =
false;
671 #if ETL_CPP17_SUPPORTED
672 template <
typename T1,
typename T2>
673 inline constexpr
bool is_base_of_v = is_base_of<T1, T2>::value;
678 namespace private_type_traits
680 template <
typename T>
char test(
int T::*);
682 struct dummy {
char c[2]; };
683 template <
typename T> dummy test(...);
686 template <
typename T>
689 #if ETL_CPP17_SUPPORTED
690 template <
typename T>
691 inline constexpr
bool is_class_v = is_class<T>::value;
696 template <
typename T>
struct add_lvalue_reference {
typedef T& type; };
697 template <
typename T>
struct add_lvalue_reference<T&> {
typedef T& type; };
698 template <>
struct add_lvalue_reference<void> {
typedef void type; };
699 template <>
struct add_lvalue_reference<const void> {
typedef const void type; };
700 template <>
struct add_lvalue_reference<volatile void> {
typedef volatile void type; };
701 template <>
struct add_lvalue_reference<const volatile void> {
typedef const volatile void type; };
703 #if ETL_CPP14_SUPPORTED
704 template <
typename T>
705 using add_lvalue_reference_t =
typename etl::add_lvalue_reference<T>::type;
710 #if ETL_CPP11_SUPPORTED
711 template <
typename T>
struct add_rvalue_reference {
using type = T && ; };
712 template <
typename T>
struct add_rvalue_reference<T&> {
using type = T & ; };
713 template <>
struct add_rvalue_reference<void> {
using type = void; };
714 template <>
struct add_rvalue_reference<const void> {
using type =
const void; };
715 template <>
struct add_rvalue_reference<volatile void> {
using type =
volatile void; };
716 template <>
struct add_rvalue_reference<const volatile void> {
using type =
const volatile void; };
719 #if ETL_CPP14_SUPPORTED
720 template <
typename T>
721 using add_rvalue_reference_t =
typename etl::add_rvalue_reference<T>::type;
726 #if ETL_CPP11_SUPPORTED
727 template <
typename T>
728 typename etl::add_rvalue_reference<T>::type declval() ETL_NOEXCEPT;
733 #if ETL_CPP11_SUPPORTED
734 namespace private_type_traits
739 template <
typename T>
740 auto returnable(
int)->true_type_for<T()>;
743 auto returnable(...)->etl::false_type;
745 template <
typename TFrom,
typename TTo>
746 auto nonvoid_convertible(
int)->true_type_for<decltype(etl::declval<
void(&)(TTo)>()(etl::declval<TFrom>()))
748 template <
typename,
typename>
749 auto nonvoid_convertible(...)->etl::false_type;
752 #if defined(ETL_COMPILER_ARM5)
753 template <
typename TFrom,
typename TTo>
756 template <
typename TFrom,
typename TTo>
757 struct is_convertible :
etl::integral_constant<bool, (decltype(private_type_traits::returnable<TTo>(0))::value &&
758 decltype(private_type_traits::nonvoid_convertible<TFrom, TTo>(0))::value) ||
759 (etl::is_void<TFrom>::value && etl::is_void<TTo>::value)> {};
763 #if ETL_CPP17_SUPPORTED
764 template <
typename TFrom,
typename TTo >
765 inline constexpr
bool is_convertible_v = etl::is_convertible<TFrom, TTo>::value;
771 #if ETL_CPP11_SUPPORTED && !defined(ETL_COMPILER_ARM5)
772 template <
typename T>
struct alignment_of : integral_constant<size_t, alignof(T)> { };
773 #elif defined(ETL_COMPILER_MICROSOFT)
774 template <
typename T>
struct alignment_of : integral_constant<size_t, size_t(__alignof(T))> {};
775 #elif defined(ETL_COMPILER_IAR) || defined(ETL_COMPILER_TI)
776 template <
typename T>
struct alignment_of : integral_constant<size_t, size_t(__ALIGNOF__(T))> {};
778 template <
typename T>
struct alignment_of : integral_constant<size_t, size_t(__alignof__(T))> {};
783 template <>
struct alignment_of<void> : integral_constant <size_t, 0> {};
785 #if ETL_CPP17_SUPPORTED
786 template <
typename T>
799 template <
typename T, const T VALUE>
807 #if ETL_CPP17_SUPPORTED
818 #if ETL_CPP17_SUPPORTED
819 template <
typename T>
824 template <
typename T>
825 inline constexpr
bool negation_v = std::negation_v<T>;
833 #if ETL_CPP14_SUPPORTED
834 template <
typename T>
835 using remove_reference_t = std::remove_reference_t<T>;
843 #if ETL_CPP14_SUPPORTED
844 template <
typename T>
845 using remove_pointer_t = std::remove_pointer_t<T>;
851 template <
typename T>
struct add_pointer : std::add_pointer<T> {};
853 #if ETL_CPP14_SUPPORTED
854 template <
typename T>
855 using add_pointer_t = std::add_pointer_t<T>;
861 template <
typename T>
struct is_const : std::is_const<T> {};
863 #if ETL_CPP17_SUPPORTED
864 template <
typename T>
865 inline constexpr
bool is_const_v = std::is_const_v<T>;
873 #if ETL_CPP14_SUPPORTED
874 template <
typename T>
875 using remove_const_t = std::remove_const_t<T>;
881 template <
typename T>
struct add_const : std::add_const<T> {};
883 #if ETL_CPP14_SUPPORTED
884 template <
typename T>
885 using add_const_t = std::add_const_t<T>;
891 template <
typename T>
struct is_volatile : std::is_volatile<T> {};
893 #if ETL_CPP17_SUPPORTED
894 template <
typename T>
895 inline constexpr
bool is_volatile_v = std::is_volatile_v<T>;
903 #if ETL_CPP14_SUPPORTED
904 template <
typename T>
905 using remove_volatile_t = std::remove_volatile_t<T>;
913 #if ETL_CPP14_SUPPORTED
914 template <
typename T>
915 using add_volatile_t = std::add_volatile_t<T>;
921 template <
typename T>
struct remove_cv : std::remove_cv<T> {};
923 #if ETL_CPP14_SUPPORTED
924 template <
typename T>
925 using remove_cv_t = std::remove_cv_t<T>;
931 template <
typename T>
struct add_cv : std::add_cv<T> {};
933 #if ETL_CPP14_SUPPORTED
934 template <
typename T>
935 using add_cv_t = std::add_cv_t<T>;
941 template <
typename T>
struct is_integral : std::is_integral<T> {};
943 #if ETL_CPP17_SUPPORTED
944 template <
typename T>
945 inline constexpr
bool is_integral_v = std::is_integral_v<T>;
951 template <
typename T>
struct is_signed : std::is_signed<T> {};
953 #if ETL_CPP17_SUPPORTED
954 template <
typename T>
955 inline constexpr
bool is_signed_v = std::is_signed_v<T>;
961 template <
typename T>
struct is_unsigned : std::is_unsigned<T> {};
963 #if ETL_CPP17_SUPPORTED
964 template <
typename T>
965 inline constexpr
bool is_unsigned_v = std::is_unsigned_v<T>;
973 #if ETL_CPP17_SUPPORTED
974 template <
typename T>
975 inline constexpr
bool is_floating_point_v = std::is_floating_point_v<T>;
981 template <
typename T1,
typename T2>
struct is_same : std::is_same<T1, T2> {};
983 #if ETL_CPP17_SUPPORTED
984 template <
typename T1,
typename T2>
985 inline constexpr
bool is_same_v = std::is_same_v<T1, T2>;
991 template<
typename T>
struct is_void : std::is_void<T> {};
993 #if ETL_CPP17_SUPPORTED
994 template <
typename T>
995 inline constexpr
bool is_void_v = std::is_void_v<T>;
1003 #if ETL_CPP17_SUPPORTED
1004 template <
typename T>
1005 inline constexpr
bool is_arithmetic_v = std::is_arithmetic_v<T>;
1013 #if ETL_CPP17_SUPPORTED
1014 template <
typename T>
1015 inline constexpr
bool is_fundamental_v = std::is_fundamental_v<T>;
1023 #if ETL_CPP17_SUPPORTED
1024 template <
typename T>
1025 inline constexpr
bool is_compound_v = std::is_compound_v<T>;
1031 template <
typename T>
struct is_array : std::is_array<T> {};
1033 #if ETL_CPP17_SUPPORTED
1034 template <
typename T>
1035 inline constexpr
bool is_array_v = std::is_array_v<T>;
1043 #if ETL_CPP17_SUPPORTED
1044 template <
typename T>
1045 inline constexpr
bool is_pointer_v = std::is_pointer_v<T>;
1053 #if ETL_CPP17_SUPPORTED
1054 template <
typename T>
1055 inline constexpr
bool is_reference_v = std::is_reference_v<T>;
1063 #if ETL_CPP17_SUPPORTED
1064 template <
typename T>
1065 inline constexpr
bool is_lvalue_reference_v = std::is_lvalue_reference_v<T>;
1071 #if ETL_CPP11_SUPPORTED
1072 template<
typename T>
struct is_rvalue_reference : std::is_rvalue_reference<T> {};
1074 #if ETL_CPP17_SUPPORTED
1075 template <
typename T>
1076 inline constexpr
bool is_rvalue_reference_v = std::is_rvalue_reference_v<T>;
1083 template <
typename T>
1084 struct is_pod : std::integral_constant<bool, std::is_standard_layout<T>::value && std::is_trivial<T>::value> {};
1086 #if ETL_CPP17_SUPPORTED
1087 template <
typename T>
1088 inline constexpr
bool is_pod_v = std::is_standard_layout_v<T> && std::is_trivial_v<T>;
1091 #if defined(ETL_COMPILER_GCC)
1092 #if ETL_COMPILER_VERSION >= 5
1093 #define ETL_GCC_V5_TYPE_TRAITS_SUPPORTED
1097 #if !defined(ARDUINO) && ETL_NOT_USING_STLPORT && defined(ETL_GCC_V5_TYPE_TRAITS_SUPPORTED)
1103 #if ETL_CPP17_SUPPORTED
1104 template <
typename T>
1105 inline constexpr
bool is_trivially_constructible_v = std::is_trivially_constructible_v<T>;
1111 template <
typename T>
struct is_trivially_copy_constructible : std::is_trivially_copy_constructible<T> {};
1113 #if ETL_CPP17_SUPPORTED
1114 template <
typename T>
1115 inline constexpr
bool is_trivially_copy_constructible_v = std::is_trivially_copy_constructible_v<T>;
1121 template <
typename T>
struct is_trivially_destructible : std::is_trivially_destructible<T> {};
1123 #if ETL_CPP17_SUPPORTED
1124 template <
typename T>
1125 inline constexpr
bool is_trivially_destructible_v = std::is_trivially_destructible_v<T>;
1131 template <
typename T>
struct is_trivially_copy_assignable : std::is_trivially_copy_assignable<T> {};
1133 #if ETL_CPP17_SUPPORTED
1134 template <
typename T>
1135 inline constexpr
bool is_trivially_copy_assignable_v = std::is_trivially_copy_assignable_v<T>;
1141 template <
typename T>
struct is_trivially_copyable : std::is_trivially_copyable<T> {};
1143 #if ETL_CPP17_SUPPORTED
1144 template <
typename T>
1145 inline constexpr
bool is_trivially_copyable_v = std::is_trivially_copyable_v<T>;
1153 #if ETL_CPP17_SUPPORTED
1154 template <
typename T>
1155 inline constexpr
bool is_trivially_constructible_v = std::is_pod_v<T>;
1163 #if ETL_CPP17_SUPPORTED
1164 template <
typename T>
1165 inline constexpr
bool is_trivially_copy_constructible_v = std::is_pod_v<T>;
1173 #if ETL_CPP17_SUPPORTED
1174 template <
typename T>
1175 inline constexpr
bool is_trivially_destructible_v = std::is_pod_v<T>;
1183 #if ETL_CPP17_SUPPORTED
1184 template <
typename T>
1185 inline constexpr
bool is_trivially_copy_assignable_v = std::is_pod_v<T>;
1193 #if ETL_CPP17_SUPPORTED
1194 template <
typename T>
1195 inline constexpr
bool is_trivially_copyable_v = std::is_pod_v<T>;
1202 template <
bool B,
typename T,
typename F>
struct conditional {
typedef T type; };
1203 template <
typename T,
typename F>
struct conditional<false, T, F> {
typedef F type; };
1210 #if ETL_CPP14_SUPPORTED
1211 template <
typename T>
1212 using make_signed_t = std::make_signed_t<T>;
1220 #if ETL_CPP14_SUPPORTED
1221 template <
typename T>
1222 using make_unsigned_t = std::make_unsigned_t<T>;
1228 template <
bool B,
typename T =
void>
struct enable_if : std::enable_if<B, T> {};
1230 #if ETL_CPP14_SUPPORTED
1231 template <
bool B,
typename T =
void>
1232 using enable_if_t = std::enable_if_t<B, T>;
1238 template <
typename T,
size_t MAXN = 0U>
1241 #if ETL_CPP17_SUPPORTED
1242 template <
typename T,
size_t MAXN = 0U>
1243 inline constexpr
size_t extent_v = std::extent_v<T, MAXN>;
1251 #if ETL_CPP14_SUPPORTED
1252 template <
typename T>
1253 using remove_extent_t = std::remove_extent_t<T>;
1261 #if ETL_CPP14_SUPPORTED
1262 template <
typename T>
1263 using remove_all_extents_t = std::remove_all_extents_t<T>;
1269 template <
typename T>
struct rank : std::rank<T> {};
1271 #if ETL_CPP17_SUPPORTED
1272 template <
typename T>
1273 inline constexpr
size_t rank_v = std::rank_v<T>;
1279 template <
typename T>
struct decay : std::decay<T> {};
1281 #if ETL_CPP14_SUPPORTED
1282 template <
typename T>
1283 using decay_t = std::decay_t<T>;
1289 template<
typename TBase,
typename TDerived>
struct is_base_of : std::is_base_of<TBase, TDerived> {};
1291 #if ETL_CPP17_SUPPORTED
1292 template <
typename TBase,
typename TDerived>
1293 inline constexpr
bool is_base_of_v = std::is_base_of_v<TBase, TDerived>;
1298 template <
typename T>
struct is_class : std::is_class<T>{};
1300 #if ETL_CPP17_SUPPORTED
1301 template <
typename T>
1309 #if ETL_CPP14_SUPPORTED
1310 template <
typename T>
1311 using add_lvalue_reference_t = std::add_lvalue_reference_t<T>;
1316 #if ETL_CPP11_SUPPORTED
1317 template <
typename T>
struct add_rvalue_reference : std::add_rvalue_reference<T> {};
1320 #if ETL_CPP14_SUPPORTED
1321 template <
typename T>
1322 using add_rvalue_reference_t = std::add_rvalue_reference_t<T>;
1327 #if ETL_CPP11_SUPPORTED
1328 template <
typename T>
1329 typename std::add_rvalue_reference<T>::type declval() ETL_NOEXCEPT;
1335 #if ETL_CPP11_SUPPORTED
1336 template <
typename TFrom,
typename TTo>
1337 struct is_convertible : std::is_convertible<TFrom, TTo> {};
1340 #if ETL_CPP17_SUPPORTED
1341 template <
typename TFrom,
typename TTo>
1342 inline constexpr
bool is_convertible_v = std::is_convertible_v<TFrom, TTo>;
1349 template <>
struct alignment_of<void> : std::integral_constant<size_t, 0> {};
1351 #if ETL_CPP17_SUPPORTED
1352 template <
typename T>
1353 inline constexpr
size_t alignment_of_v = std::alignment_of_v<T>;
1365 template <
bool B,
typename T, T TRUE_VALUE, T FALSE_VALUE>
1368 template <
typename T, T TRUE_VALUE, T FALSE_VALUE>
1372 static const T value = TRUE_VALUE;
1375 template <
typename T, T TRUE_VALUE, T FALSE_VALUE>
1379 static const T value = FALSE_VALUE;
1383 #if ETL_CPP11_SUPPORTED
1387 template <
typename T,
typename T1,
typename... TRest>
1394 template <
typename T,
typename T1>
1395 struct is_one_of<T, T1>
1425 #if ETL_CPP17_SUPPORTED
1426 template <
typename T,
typename... TRest>
1427 inline constexpr
bool is_one_of_v =
etl::is_one_of<T, TRest...>::value;
1435 template <
typename T>
1444 typedef type_t type;
1445 typedef type_t& reference;
1446 typedef const type_t& const_reference;
1447 typedef type_t* pointer;
1448 typedef const type_t* const_pointer;
1449 typedef const type_t*
const const_pointer_const;
1451 #if ETL_CPP11_SUPPORTED
1452 typedef type_t&& rvalue_reference;
1457 template <
typename T>
1466 typedef type_t type;
1467 typedef type_t& reference;
1468 typedef const type_t& const_reference;
1469 typedef type_t* pointer;
1470 typedef const type_t* const_pointer;
1471 typedef const type_t*
const const_pointer_const;
1473 #if ETL_CPP11_SUPPORTED
1474 typedef type_t&& rvalue_reference;
1479 template <
typename T>
1488 typedef type_t type;
1489 typedef type_t& reference;
1490 typedef const type_t& const_reference;
1491 typedef type_t* pointer;
1492 typedef const type_t* const_pointer;
1493 typedef const type_t*
const const_pointer_const;
1495 #if ETL_CPP11_SUPPORTED
1496 typedef type_t&& rvalue_reference;
1501 template <
typename T>
1510 typedef type_t type;
1511 typedef type_t& reference;
1512 typedef const type_t& const_reference;
1513 typedef type_t* pointer;
1514 typedef const type_t* const_pointer;
1515 typedef const type_t*
const const_pointer_const;
1517 #if ETL_CPP11_SUPPORTED
1518 typedef type_t&& rvalue_reference;
1522 #if ETL_CPP11_SUPPORTED
1524 template <
typename T>
1533 typedef type_t type;
1534 typedef type_t& reference;
1535 typedef const type_t& const_reference;
1536 typedef type_t* pointer;
1537 typedef const type_t* const_pointer;
1538 typedef const type_t*
const const_pointer_const;
1540 #if ETL_CPP11_SUPPORTED
1541 typedef type_t&& rvalue_reference;
1546 #if ETL_CPP11_SUPPORTED
1547 template <
typename T>
1548 using types_t =
typename types<T>::type;
1550 template <
typename T>
1551 using types_r =
typename types<T>::reference;
1553 template <
typename T>
1554 using types_cr =
typename types<T>::const_reference;
1556 template <
typename T>
1557 using types_rr =
typename types<T>::rvalue_reference;
1559 template <
typename T>
1560 using types_p =
typename types<T>::pointer;
1562 template <
typename T>
1563 using types_cp =
typename types<T>::const_pointer;
1565 template <
typename T>
1566 using types_cpc =
typename types<T>::const_pointer_const;
1575 #if ETL_CPP17_SUPPORTED
1576 template <
typename T>
1580 #if ETL_CPP11_SUPPORTED
1583 template <
typename T,
typename T1,
typename... TRest>
1587 etl::are_all_same<T, TRest...>::value;
1590 template <
typename T,
typename T1>
1591 struct are_all_same<T, T1>
1597 #if ETL_CPP17_SUPPORTED
1598 template <
typename T,
typename T1,
typename... TRest>
1599 inline constexpr
bool are_all_same_v = are_all_same<T, T1, TRest...>::value;
integral_constant< bool, false > false_type
integral_constant specialisations
Definition: type_traits_generator.h:804
add_const
Definition: type_traits_generator.h:881
add_cv
Definition: type_traits_generator.h:931
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_compound
Definition: type_traits_generator.h:1021
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
add_lvalue_reference
Definition: type_traits_generator.h:1307
Definition: type_traits_generator.h:812
conditional_integral_constant
Definition: type_traits_generator.h:1366
is_class
Definition: type_traits_generator.h:1298
Definition: type_traits.h:1397
negation
Definition: type_traits.h:114
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