#include #include #include template struct function_traits; template struct function_traits { using arity = std::integral_constant; using result_type = RType; using arg_tuple = std::tuple; template using arg_type = typename std::tuple_element::type; }; namespace details { template struct function_type_impl : function_type_impl { }; template struct function_type_impl { using type = RType(ArgTypes...); }; template struct function_type_impl { using type = RType(ArgTypes...); }; template struct function_type_impl> { using type = RType(ArgTypes...); }; template struct function_type_impl { using type = RType(ArgTypes...); }; template struct function_type_impl { using type = RType(ArgTypes...); }; } template struct function_type : details::function_type_impl::type>::type> { }; // --- shortcuts --- template using function_type_traits_t = function_traits::type>; template constexpr auto function_arity_val = function_type_traits_t::arity::value; template using function_arg_tuple_t = typename function_type_traits_t::arg_tuple;