2017-08-13 34 views
0

我只是想学拉姆达 的一些特点试过这里提供通用拉姆达的Xcode 8.3.3

How does generic lambda work in C++14?

auto glambda = [](auto a) { return a; }; 

的例子之一,但我不知道出于某种原因Xcode的抱怨它

auto not allowed in lambda parameter

汽车不是所有拉姆达参数

1)我丢失的东西在安装或库

会理解的理由欠任何停机投票

+0

你能在项目设置C++ 14?上面的代码为我编译。 – combinatorial

+0

@combinatorial任何具体的事情要做..你是否这样做 –

+1

https://stackoverflow.com/questions/33358313/cant-get-c14-using-xcode-7-0-1 – WindyFields

回答

1

选择在Xcode左侧面板项目。然后选择Build Settings选项卡。在右上角的筛选器中键入“C++语言”。然后将方言的设置更改为C++ 14或GNU ++ 14。

Where to change the compiler setting to enable C++14

+0

伟大的工作非常感谢。我认为你的答案对像我这样的xcode的新用户更有帮助。有更多的信息,然后https://stackoverflow.com/questions/33358313/cant-get-c14-using-xcode-7-0-1 –