For c++20 it is proposed to add the following syntax for generic lambdas p0428r2.pdf
auto f = [](
The result of a lambda expression is not a function; it is a function object. That is, it is a class type that has an operator()
overload on it. So this:
auto f = []<typename T>( T t ) {};
Is equivalent to this:
struct unnamed
{
template<typename T>
void operator()(T t) {}
};
auto f = unnamed{};
If you want to explicitly provide template arguments to a lambda function, you have to call operator()
explicitly: f.operator()<template arguments>(parameters);
.