问题
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
isliteral
in C++/CLI, and - C#
readonly
isinitonly
in C++/CLI
来源:https://stackoverflow.com/questions/7469224/c-cli-equivalent-of-cs-readonly-keyword