This seems to be solved for the case of lambdas in this question. But that one is a 2011 answer and I\'m looking for a general case: lambdas, regular functions, and functors
std::result_of::type a;
(Taken from here.)