C ++ / CLI pin_ptr [英] C++/CLI pin_ptr

查看:223
本文介绍了C ++ / CLI pin_ptr的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是C ++ / CLI的 pin_ptr 相当于C#的固定语句

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

推荐答案

是的,差不多。

一些区别:


  1. A code>语句创建自己的作用域块。 pin_ptr 的范围是从其初始化到封闭块的
    结尾。

  2. fixed 是一种显式语言特性。 pin_ptr 是使用一般语言功能(C ++范本)。(请参阅注解。)

  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.

这篇关于C ++ / CLI pin_ptr的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆