V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
Dimen61
V2EX  ›  问与答

如何更改 VS2010 的编译器?

  •  
  •   Dimen61 · 2016-10-12 11:37:39 +08:00 · 1915 次点击
    这是一个创建于 2752 天前的主题,其中的信息可能已经有所发展或是发生改变。

    因为在程序中使用了匿名函数,但在 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();
    }
    
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5378 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 08:35 · PVG 16:35 · LAX 01:35 · JFK 04:35
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.