通用Lambda Xcode 8.3.3 [英] Generic lambda xcode 8.3.3

查看:55
本文介绍了通用Lambda Xcode 8.3.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想学习lambda的一些功能尝试了此处提供的示例之一

中不允许使用

lambda参数不允许自动

1)安装或库中缺少的内容

将对任何不赞成投票的理由表示赞赏

解决方案

在Xcode的左侧面板中选择您的项目.然后选择构建设置"选项卡.在右上角的过滤器中输入"C ++语言".然后将方言的设置更改为C ++ 14或GNU ++ 14.

I was just trying to learn some features of lambda Tried one of the example provided here

How does generic lambda work in C++14?

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

But I don't know for some reason xcode complains about it

auto not allowed in lambda parameter

1) Something I am missing in the installation or library

Will Appreciate justification for any down vote

解决方案

Select your project in the left-hand panel in Xcode. Then choose the Build Settings tab. Type "C++ Language" in the filter at the top right. And then change the setting for the dialect to C++14 or GNU++14.

这篇关于通用Lambda Xcode 8.3.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆