What does ^ after a type mean in c++?

拈花ヽ惹草 提交于 2019-12-23 08:58:02

问题


I have some c++ code with function return types declared as string^ or IEnumerable<String^>^, what does that mean?

edits: c#->c++/cli


回答1:


It doesn't mean anything in C#. You're looking at source code for C++/CLI, not C#.

See http://en.wikipedia.org/wiki/C%2B%2B/CLI for a brief introduction.

The carat symbol basically means "this is a GC-tracked reference".




回答2:


It seems like managed C++, not C#. ^ means managed reference type.




回答3:


Nothing. It is not valid there in C++. It's a "managed reference" type modifier for C++/CLI, a distinct language.



来源:https://stackoverflow.com/questions/4599290/what-does-after-a-type-mean-in-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!