错误C3481:'Out':在C ++ / CLI中调用ObjectIDGenerator.GetID时找不到lambda捕获变量(error C3481: 'Out&#

编程入门 行业动态 更新时间:2024-10-25 06:20:30
错误C3481:'Out':在C ++ / CLI中调用ObjectIDGenerator.GetID时找不到lambda捕获变量(error C3481: 'Out': lambda capture variable not found while calling ObjectIDGenerator.GetID in C++/CLI)

我需要在C ++ / CLI中的ObjectIDGenerator.GetID(Object ^,out bool)中传递一个布尔值。 遇到类似这里描述的问题。 http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/2ec8e666-ecac-491e-bfb1-1b9108f7eb92通过网络搜索此课程..此错误的新内容和Lambda的概念。 所以阅读这仍然得到上述错误..我做错了什么?

I need to pass a boolean value in the ObjectIDGenerator.GetID(Object^,out bool) in C++/CLI. Having a similar problem as described here. http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/2ec8e666-ecac-491e-bfb1-1b9108f7eb92 Searched over the net for this class.. New to this error and to the concept of Lambda. So read THIS Still getting the above error..What am I doing wrong?

最满意答案

只需传递一个bool类型的左值:

ObjectIDGenerator ^generator; Object ^o; bool isFirst; generator->GetID(o, isFirst);

没有涉及lambdas。 你的错误的原因是你必须在代码中的某个地方卡住[Out] ,这样看起来像编译器就像lambda一样。 但是在调用函数时从不使用[Out] 。

Just pass an lvalue of type bool:

ObjectIDGenerator ^generator; Object ^o; bool isFirst; generator->GetID(o, isFirst);

There are no lambdas involved. The reason for your error is that you must have stuck [Out] somewhere in your code, which looked to the compiler like a lambda. But [Out] is never used when calling a function.

更多推荐

本文发布于:2023-07-04 16:53:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1026870.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:找不到   变量   错误   CLI   ObjectIDGenerator

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!