在VS 2015年考虑这段代码:为什么非捕获的变量会引发警告?
int a,b;
[]
{
int a; // C4456: declaration of 'a' hides previous local declaration
};
为什么a
拉姆达给予警告等?它在VS2013中编译得很好。
编辑:有趣的是,(和不正确的),下面是不是在VS2013的错误:
[a]
{
int a; // No error, even if `a` is captured.
a++;
};
我不确定后一种情况应该是错误的。前者看起来像是一个编译器bug。 – user2079303 2014-11-21 10:01:24