#ifndef BOOST_TYPE_TRAITS_SIGNATURE_OF_HPP_INCLUDED #define BOOST_TYPE_TRAITS_SIGNATURE_OF_HPP_INCLUDED #include #include #include #include namespace boost { // a more flexible variant of result_of is needed namespace detail { template struct result_of { protected: template ::value> struct switch_call { using type = typename decltype(std::mem_fn(Function{}))::result_type; }; template struct switch_call { using type = typename decltype(std::function(Function{}))::result_type; }; public: using type = typename switch_call::type; }; template using result_of_t = typename result_of::type; } // detail template struct argument_of { protected: // operator() template struct switch_call : switch_call {}; // function template struct switch_call { using type = std::tuple; }; template struct switch_call { using type = std::tuple; }; // method template struct switch_call { using type = std::tuple; }; template struct switch_call { using type = std::tuple; }; template struct switch_call { using type = std::tuple; }; template struct switch_call { using type = std::tuple; }; public: using type = typename switch_call::type; }; template using argument_of_t = typename argument_of::type; template struct argument_size : integral_constant < std::size_t, std::tuple_size_v> > {}; template inline constexpr std::size_t argument_size_v = argument_size::value; template struct signature_of { using argument_type = argument_of_t; using result_type = detail::result_of_t; }; } // boost #endif // BOOST_TYPE_TRAITS_SIGNATURE_OF_HPP_INCLUDED