如何更改 VS2010 的编译器?

2016-10-12 11:37:39 +08:00
 Dimen61

因为在程序中使用了匿名函数,但在 VS2010 中编译有问题。但把同样的代码用 G++来编译就没有问题。。

所以请问如何更改 vs2010 的编译器?

代码简化如下:

#include <algorithm>
#include <iostream>

using namespace std;

int main()
{
    struct Fun {
        int x, y, z;
        
        Fun():x(0), y(0), z(0) {}
    };
    auto fFun = [&]() {
        Fun f;
        cout << f.x << " " << f.y << " " << f.z << endl;
    };

    fFun();
}
1926 次点击
所在节点    问与答
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/312155

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX