开发者

Do I still write String^ const in C++/CLI

开发者 https://www.devze.com 2022-12-25 21:07 出处:网络
In C++ it\'s recommended to have const-correctness everywhere. But s开发者_JAVA技巧ince in .Net world, the string content cannot be changed, (new string will be created), do I still write String^ cons

In C++ it's recommended to have const-correctness everywhere. But s开发者_JAVA技巧ince in .Net world, the string content cannot be changed, (new string will be created), do I still write String^ const?


No. Just pass a handle to a string directly: method(String^ string)

0

精彩评论

暂无评论...
验证码 换一张
取 消