13 #include <type_traits>
64 template <
class Default,
class AlwaysVoid,
template <
class...>
class Op,
77 template <
class Default,
template <
class...>
class Op,
class... Args>
96 template <
template <
class...>
class Op,
class... Args>
106 template <
template <
class...>
class Op,
class... Args>
117 template <
class Expected,
template <
class...>
class Op,
class... Args>
128 template <
class To,
template <
class...>
class Op,
class... Args>
139 template <
class Default,
template <
class...>
class Op,
class... Args>
152 template <
bool... Bs>
160 template <
bool... Bs>
167 template <
bool... Bs>
175 template <
template <
class...>
class Op,
class... Args>
184 template <
class To,
template <
class...>
class Op,
class... Args>
193 template <
class Exact,
template <
class...>
class Op,
class... Args>
205 template <
typename T,
typename R,
template <
class...>
class M,
206 typename... Arguments>
216 template <
typename T,
template <
class...>
class M,
typename V>
340 #define METHOD_TRAIT(trait_name, method_name) \
341 template <class T, typename R, typename... Arguments> \
342 struct trait_name { \
345 template <typename T_> \
346 static constexpr bool is_const = \
347 not std::is_same_v<std::remove_const_t<T_>, T_>; \
357 template <typename T_, typename = int> \
359 template <typename... Arguments_> \
360 using type = typename std::integral_constant< \
361 decltype(std::declval<T_>().method_name( \
362 std::declval<Arguments_>()...)) (T_::*)(Arguments_...), \
363 &T_::method_name>::value_type; \
370 template <typename T_> \
371 struct fptr_meta<T_, std::enable_if_t<is_const<T_>, int>> { \
372 template <typename... Arguments_> \
373 using type = typename std::integral_constant< \
374 decltype(std::declval<T_>().method_name( \
375 std::declval<Arguments_>()...)) (T_::*)(Arguments_...) const, \
376 &T_::method_name>::value_type; \
380 template <typename T_, typename... Arguments_> \
381 using fptr_meta_t = typename fptr_meta<T_>::template type<Arguments_...>; \
385 template <typename T_, typename... Arguments_> \
386 using qual_ret = decltype( \
387 std::declval<T_>().method_name(std::declval<Arguments_>()...)); \
397 template <typename T_, typename = int> \
399 static constexpr bool value = false; \
401 template <typename T_> \
402 struct tv<T_, std::enable_if_t< \
403 is_detected_exact<R, qual_ret, T_, Arguments...>::value, \
406 static constexpr bool value = \
407 is_detected<fptr_meta_t, T, Arguments...>::value; \