1 #ifndef _TUPLEORDER_HPP 2 #define _TUPLEORDER_HPP 8 #include <ints/Ranges.hpp> 9 #include <tuple/TupleClass.hpp> 10 #include <utility/Position.hpp> 17 template <
bool assertIfNotPresent,
19 constexpr
int _posOfType(T,Tuple<>)
22 static_assert(assertIfNotPresent==DO_NOT_ASSERT_IF_NOT_PRESENT,
"Type not found in the list");
30 template <
bool assertIfNotPresent,
34 constexpr
int _posOfType(T,Tuple<Head,Tail...>)
37 constexpr
bool isHead=
41 constexpr
int posInTail=
42 _posOfType<DO_NOT_ASSERT_IF_NOT_PRESENT>(T{},Tuple<Tail...>{});
45 constexpr
bool isInTail=
46 posInTail!=NOT_PRESENT;
51 static_assert(
not isInTail,
"Multiple case present!");
56 if constexpr(isInTail)
76 _posOfType<ASSERT_IF_NOT_PRESENT>(T{},Tp{});
92 _posOfType<DO_NOT_ASSERT_IF_NOT_PRESENT>(T{},Tp{});
102 -> IntSeq<_posOfType<assertIfNotPresent>(T{},TP{})...>;
107 template <
typename TpToSearch,
110 decltype(_posOfTypes<ASSERT_IF_NOT_PRESENT>(TpToSearch{},TpToProbe{}));
115 template <
typename TpToSearch,
117 using PosOfTypesNotAsserting=
118 decltype(_posOfTypes<DO_NOT_ASSERT_IF_NOT_PRESENT>(TpToSearch{},TpToProbe{}));
constexpr int posOfTypeNotAsserting
auto _posOfTypes(Tuple< T... > t, TP tp) -> IntSeq< _posOfType< assertIfNotPresent >(T
Position of the types T in the Tuple TP, asserting or not.