29 #ifndef ETL_PARAMETER_PACK
30 #define ETL_PARAMETER_PACK
37 #if ETL_CPP11_NOT_SUPPORTED
38 #error NOT SUPPORTED FOR C++03 OR BELOW
46 template <
typename... TTypes>
51 static constexpr
size_t size =
sizeof...(TTypes);
62 template <
typename Type,
typename T1,
typename... TRest>
63 struct index_of_type_helper
65 static constexpr
size_t value = std::is_same<Type, T1>::value ? 1 : 1 + index_of_type_helper<Type, TRest...>::value;
69 template <
typename Type,
typename T1>
70 struct index_of_type_helper<Type, T1>
72 static constexpr
size_t value = 1;
80 static constexpr
size_t value = index_of_type_helper<T, TTypes...>::value - 1;
83 #if ETL_CPP17_SUPPORTED
85 static constexpr
size_t index_of_type_v = index_of_type<T>::value;
97 template <
size_t II,
size_t N,
typename T1,
typename... TRest>
98 struct type_from_index_helper
100 using type =
typename std::conditional<II == N, T1,
typename type_from_index_helper<II, N + 1, TRest...>::type>::type;
104 template <
size_t II,
size_t N,
typename T1>
105 struct type_from_index_helper<II, N, T1>
112 static_assert(I <
sizeof...(TTypes),
"Index out of bounds of parameter pack");
115 using type =
typename type_from_index_helper<I, 0, TTypes...>::type;
120 using type_from_index_t =
typename type_from_index<I>::type;
Definition: absolute.h:37
Definition: type_traits.h:1397