Get the type of the return value in C++
问题 Suppose we have a function f which returns a value of some unknown type (let's call it T ) and takes a value of the type T as an argument (and possibly has some other arguments). How do I get the return type of f in C++14? There is a way to do it if we know the know the argument types (via std::result_of ). Is it possible if we know all the argument types except T ? Example: template <class F> // F is functor with T operator()(T a, T b) class A { // Here I want to do // T some_function(T some