是否有C ++ / CLI智能指针项目(例如scoped_ptr)? [英] Is there a C++/CLI smart pointer project (e.g. scoped_ptr)?
问题描述
是否有C ++ / CLI RAII智能指针类,用于在托管类型中包含本机指针?只是想知道,在我写自己的 clr_scoped_ptr
值类模板。
我知道Microsoft-提供:
-
a href =http://msdn.microsoft.com/en-us/library/ms177066.aspx>在托管类中包含托管句柄:
auto_handle
上面两个类似于 auto_ptr
或 unique_ptr
。
但是所有这些都是用于处理托管ref类实例,而不是用于释放本机对象。
这一个看起来相当完整,但我不是在寻找静默转移所有权ala 我已经在一个相当宽松的许可证下发布了我的版本 codereview.se Is there a C++/CLI RAII smart pointer class for containment of a native pointer in a managed type? Just wondering, before I go write my own I'm aware of the Microsoft-provided: containment of a managed handle in a native class: containment of a managed handle in a managed class: The above two are similar to But all these are for disposing managed ref class instances, not for freeing native objects. This one looks fairly complete, but I'm not looking for silent transfer of ownership ala I've posted my version under a rather permissive license over at codereview.se 这篇关于是否有C ++ / CLI智能指针项目(例如scoped_ptr)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! auto_ptr
。 / p>
clr_scoped_ptr
value class template.
auto_gcroot
auto_handle
auto_ptr
or unique_ptr
.auto_ptr
.