Is there a way to get the type of the parameter(s) of a lambda function in C++?
For example one can easily get the return type of a lambda function with decltype()
:
auto f = [](int x){ return x*5; };
auto lambda_container = create_some_container<decltype(f)>(f);
I want to be able to also get the type of the parameter of the function and to be able to use it in the same manner I use the return type of the lambda function in the example above.
EDIT: Existing answers do not explain how to use the type as a template argument.