GCC允许以下语法作为扩展:
// a functional object that will add two like-type objects
auto add = [] <typename T> (T a, T b) { return a + b; };
Run Code Online (Sandbox Code Playgroud)
在n3418,2012年关于通用 lambdas的提议中,我们看到允许上述语法的语法:
overload( []<class T>(T* p) {...},
Run Code Online (Sandbox Code Playgroud)
但是,由于它是一个扩展,语法显然不存在(或者不被允许).当我们有auto时,上述什么情况会有用,为什么语法不存在(或不允许)?