C++/CLI equivalent of C#'s 'readonly' keyword

﹥>﹥吖頭↗ 提交于 2020-01-01 07:33:16

问题


What's the C++/CLI equivalent of C#'s readonly keyword?

Specifically, how do you write a public or protected member of a C++/CLI class such that it is readonly when referenced from C#?


回答1:


I just found out (thanks to Literal field versus constant variable in C++/CLI) that

  • C# const is literal in C++/CLI, and
  • C# readonly is initonly in C++/CLI


来源:https://stackoverflow.com/questions/7469224/c-cli-equivalent-of-cs-readonly-keyword

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