C++/CLI pin_ptr

☆樱花仙子☆ 提交于 2020-01-03 21:09:13

问题


Is C++/CLI's pin_ptr the equivalent of C#'s fixed statement?


回答1:


Yes, pretty much.

Some differences:

  1. A fixed statement creates its own scope block. pin_ptr's scope is from its initialization to the end of the enclosing block.
  2. fixed is an explicit language feature. pin_ptr is a use of a general language feature (C++ templates).(See comments.)

There are probably more differences like the above. But, when translating between the two languages, they are generally equivalent.



来源:https://stackoverflow.com/questions/18037077/c-cli-pin-ptr

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