13 #ifndef THRILL_COMMON_FUNCTION_TRAITS_HEADER 14 #define THRILL_COMMON_FUNCTION_TRAITS_HEADER 18 #include <type_traits> 23 #ifndef THRILL_DOXYGEN_IGNORE 27 struct FunctionTraits :
public FunctionTraits<decltype(&T::operator ())> { };
33 template <
typename ClassType,
typename ReturnType,
typename... Args>
34 struct FunctionTraits<ReturnType (ClassType::*)(Args...) const> {
37 static constexpr
size_t arity =
sizeof ... (Args);
47 typename std::remove_cv<
48 typename std::remove_reference<Args>::type>::type...>;
53 using arg =
typename std::tuple_element<i, args_tuple>::type;
59 typename std::remove_cv<
60 typename std::remove_reference<arg<i> >::type>::type;
64 template <
typename ClassType,
typename ReturnType,
typename... Args>
65 struct FunctionTraits<ReturnType (ClassType::*)(Args...)>
66 :
public FunctionTraits<ReturnType (ClassType::*)(Args...) const> {
71 template <
typename ReturnType,
typename... Args>
72 struct FunctionTraits<ReturnType (*)(Args...)> {
75 static constexpr
size_t arity =
sizeof ... (Args);
85 typename std::remove_cv<
86 typename std::remove_reference<Args>::type>::type...>;
91 using arg =
typename std::tuple_element<i, args_tuple>::type;
97 typename std::remove_cv<
98 typename std::remove_reference<arg<i> >::type>::type;
104 #endif // !THRILL_COMMON_FUNCTION_TRAITS_HEADER std::tuple< typename std::remove_cv< typename std::remove_reference< Args >::type >::type... > args_tuple_plain
the tuple of arguments: with remove_cv and remove_reference applied.
typename std::remove_cv< typename std::remove_reference< arg< i > >::type >::type arg_plain
std::tuple< Args... > args_tuple
the tuple of arguments
typename std::remove_cv< typename std::remove_reference< arg< i > >::type >::type arg_plain
typename std::tuple_element< i, args_tuple >::type arg
std::tuple< Args... > args_tuple
the tuple of arguments
typename std::tuple_element< i, args_tuple >::type arg
std::tuple< typename std::remove_cv< typename std::remove_reference< Args >::type >::type... > args_tuple_plain
the tuple of arguments: with remove_cv and remove_reference applied.