Is it possible to figure out the parameter type and return type of a lambda?
问题 Given a lambda, is it possible to figure out it\'s parameter type and return type? If yes, how? Basically, I want lambda_traits which can be used in following ways: auto lambda = [](int i) { return long(i*10); }; lambda_traits<decltype(lambda)>::param_type i; //i should be int lambda_traits<decltype(lambda)>::return_type l; //l should be long The motivation behind is that I want to use lambda_traits in a function template which accepts a lambda as argument, and I need to know it\'s parameter