26 #include <type_traits>
32 template<
class T,
class...Ts>
35 template<
class T,
class T0,
class...Ts>
39 std::is_same_v<T, T0>&&
40 is_in_types<T, Ts...>::value
43 template<
class T,
class...Ts>
71 template<
template<
class...>
class Template,
class T >
struct IsInstanceOf : std::false_type {};
75 template<
template<
class...>
class Template,
class...Params>
struct IsInstanceOf<Template, Template<Params...>> :
std:: true_type {};
77 template<
template<
class...>
class Template,
class T>
80 template<
class T,
template<
class...>
class...Templates>
83 static_assert(!IsInstanceOfAnyV<int, RemoveRvalueReference, std::tuple>);
89 template<
template<
class...>
class Template,
class...Params>
92 template<
template<
class...>
class NewTemplate>
95 template<
class...NewParams>
103 template<
class T0,
class...Ts>
104 using last_type =
typename std::decay <
typename std::tuple_element <
sizeof...(Ts), std::tuple<T0, Ts... >>::type >::type;
109 template<
class T0,
class...Ts>
114 template<
class T0,
class T1,
class...Ts>
119 template<
class T0,
class T1,
class T2,
class...Ts>
123 template<std::size_t n,
class...Ts>
125 template<std::size_t n,
class T0,
class...Ts>
128 using type =
typename std::decay <
typename std::tuple_element < n, std::tuple<T0, Ts... >>
::type >
::type;
134 template<std::size_t n,
class T0,
class...Ts>
135 using nth_type =
typename std::decay <
typename std::tuple_element < n, std::tuple<T0, Ts... >>::type >::type;
142 template<
class T,
class =
void>
151 struct HasToString <
T, typename
std::enable_if < std::is_same < decltype(std::to_string(std::declval<T>()), int {}), int >::value >::type > :
162 template<
class T,
class IdxT,
class =
void>
170 template<
class T,
class IdxT>
171 struct HasAtMethod <
T, IdxT, typename
std::enable_if < std::is_same < decltype(std::declval<T>().at(std::declval<IdxT>()), int {}), int >::value >::type > :
176 #define ARMARX_META_MAKE_HAS_MEMBER_FNC_CHECK(CHECKNAME, FNCNAME, FNCSIG) \
181 struct two { one a, b; }; \
182 template<class C, C> struct classAndFncPtr; \
184 static one has(classAndFncPtr<FNCSIG, &C::FNCNAME>*); \
186 static two has(...); \
188 static constexpr bool value = sizeof(has<T>(0)) == sizeof(one); \
191 static constexpr bool CHECKNAME##_v = CHECKNAME<T>::value
193 template<std::size_t...>
201 template<
class S1,
class S2>
203 template<std::size_t... I1, std::size_t... I2>
212 typename MakeIndexSequence < N / 2 >::type,
213 typename MakeIndexSequence < N - N / 2 >::type
216 template<std::
size_t Lo,
class>
219 template<std::size_t Lo, std::size_t...Is>
225 template<std::
size_t Lo, std::
size_t Hi>
232 template<std::
size_t N>
235 template<std::
size_t Lo, std::
size_t Hi>
249 using type =
typename std::decay<T>::type;
262 template<
class T, std::
size_t N>
283 template<
class Base,
class...Ds>
285 template<
class Base,
class D0,
class...Ds>
287 std::integral_constant <
289 std::is_base_of<Base, D0> ::value&&
290 IsBaseOf<Base, Ds...>::value
296 template<
class T,
class...Others>
297 static constexpr
bool is_any_of_v = (std::is_same_v<T, Others> || ...);
303 template <
typename S,
typename T>
306 template <
typename SS,
typename TT>
307 static auto test(
int) -> decltype(std::declval<SS&>() << std::declval<TT>(), std::true_type());
309 template <
typename,
typename>
310 static auto test(...) -> std::false_type;