Lambdas在C ++ / CLI [英] Lambdas in C++/CLI

查看:117
本文介绍了Lambdas在C ++ / CLI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在C ++ / CLI中使用lamda表达式?

How to use lamda expressions in C++/CLI?

推荐答案

在C#中,lambdas实际上只是语法糖。 C ++ / CLI 支持代表,因此您仍然可以执行所有相同的操作

In C#, lambdas are really just syntactic sugar for creating delegates. C++/CLI supports delegates, so you can still do all of the same stuff in C++/CLI that you can do in C#, you just don't get to use the nifty syntax.

个人而言,我的问题是你为什么要使用C ++ / CLI首先?仅适用于在本机C ++和C#/。NET和无其他之间编写互操作层的IMO C ++ / CLI

Personally, my question would be why are you using C++/CLI in the first place? IMO C++/CLI is only good for writing interop layers between native C++ and C#/.NET and nothing else.

这篇关于Lambdas在C ++ / CLI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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