在 C++ 可变参数 lambda 中省略 "auto" 关键字?

Eliding "auto" keyword in a C++ variadic lambda?

我最近发现这段代码在 GCC 和 MSVC 中编译都很好:

auto foo = [](...){
    cout << "foo() called" << endl;
};

它接受任意数量的任何类型的参数,并且对这些参数不做任何操作,因此它的工作方式就好像 auto 放在 ...:

之前一样
// All of these lines will call the lambda function
foo();
foo(100);
foo("Test");
foo("Testing", 1, 2, 3);

lambda functions does not seem to mention about this, and neither does the page on parameter packs 上的 C++ 参考。

更令人惊讶的是,编译失败:

auto foo = [](... x){ // compile error
    cout << "foo() called" << endl;
};

此行为是否由标准规定,如果是,为什么前者编译而后者失败?

这只是普通的老式类型不安全 C 风格 variadic arguments