8#ifndef SkCallableTraits_DEFINED
9#define SkCallableTraits_DEFINED
16 static constexpr std::size_t
arity =
sizeof...(Args);
18 static_assert(
N <
arity,
"");
19 using type =
typename std::tuple_element<
N, std::tuple<Args...>>
::type;
23#define SK_CALLABLE_TRAITS__COMMA ,
25#define SK_CALLABLE_TRAITS__VARARGS(quals, _) \
26SK_CALLABLE_TRAITS__INSTANCE(quals,) \
27SK_CALLABLE_TRAITS__INSTANCE(quals, SK_CALLABLE_TRAITS__COMMA ...)
29#ifdef __cpp_noexcept_function_type
30#define SK_CALLABLE_TRAITS__NE_VARARGS(quals, _) \
31SK_CALLABLE_TRAITS__VARARGS(quals,) \
32SK_CALLABLE_TRAITS__VARARGS(quals noexcept,)
34#define SK_CALLABLE_TRAITS__NE_VARARGS(quals, _) \
35SK_CALLABLE_TRAITS__VARARGS(quals,)
38#define SK_CALLABLE_TRAITS__REF_NE_VARARGS(quals, _) \
39SK_CALLABLE_TRAITS__NE_VARARGS(quals,) \
40SK_CALLABLE_TRAITS__NE_VARARGS(quals &,) \
41SK_CALLABLE_TRAITS__NE_VARARGS(quals &&,)
43#define SK_CALLABLE_TRAITS__CV_REF_NE_VARARGS() \
44SK_CALLABLE_TRAITS__REF_NE_VARARGS(,) \
45SK_CALLABLE_TRAITS__REF_NE_VARARGS(const,) \
46SK_CALLABLE_TRAITS__REF_NE_VARARGS(volatile,) \
47SK_CALLABLE_TRAITS__REF_NE_VARARGS(const volatile,)
53#define SK_CALLABLE_TRAITS__INSTANCE(quals, varargs) \
54template <typename R, typename... Args> \
55struct SkCallableTraits<R(Args... varargs) quals> : sk_base_callable_traits<R, Args...> {};
58#undef SK_CALLABLE_TRAITS__INSTANCE
61#define SK_CALLABLE_TRAITS__INSTANCE(quals, varargs) \
62template <typename R, typename... Args> \
63struct SkCallableTraits<R(*)(Args... varargs) quals> : sk_base_callable_traits<R, Args...> {};
66#undef SK_CALLABLE_TRAITS__INSTANCE
69#define SK_CALLABLE_TRAITS__INSTANCE(quals, varargs) \
70template <typename T, typename R, typename... Args> \
71struct SkCallableTraits<R(T::*)(Args... varargs) quals> : sk_base_callable_traits<R, Args...> {};
74#undef SK_CALLABLE_TRAITS__INSTANCE
77template <
typename T,
typename R>
80#undef SK_CALLABLE_TRAITS__CV_REF_NE_VARARGS
81#undef SK_CALLABLE_TRAITS__REF_NE_VARARGS
82#undef SK_CALLABLE_TRAITS__NE_VARARGS
83#undef SK_CALLABLE_TRAITS__VARARGS
84#undef SK_CALLABLE_TRAITS__COMMA
#define SK_CALLABLE_TRAITS__NE_VARARGS(quals, _)
#define SK_CALLABLE_TRAITS__CV_REF_NE_VARARGS()
typename std::tuple_element< N, std::tuple< Args... > >::type type
static constexpr std::size_t arity