What is the need of template lambda introduced in C++20 when C++14 already has generic lambda?
问题 c++14 introduced generic lambdas that made it possible to write following: auto func = [](auto a, auto b){ return a + b; }; auto Foo = func(2, 5); auto Bar = func("hello", "world"); It is very clear that this generic lambda func works just like a templated function func would work. Why did the C++ committee decide to add template syntax for generic lamda? 回答1: C++14 generic lambdas are a very cool way to generate a functor with an operator () that looks like this: template <class T, class U>