内存>的boost ::从标准&LT的shared_ptr和std :: shared_ptr的区别;文件 [英] Difference between boost::shared_ptr and std::shared_ptr from the standard <memory> file

查看:229
本文介绍了内存>的boost ::从标准&LT的shared_ptr和std :: shared_ptr的区别;文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果有在的boost :: shared_ptr的的std :: shared_ptr的发现之间的差异,我想知道在标准<存储器GT; 文件。

I was wondering if there are any differences between the boost::shared_ptr and the std::shared_ptr found in the standard <memory> file.

推荐答案

的std :: shared_ptr的的C ++ 0x的形式TR1: :shared_ptr的和提升的的boost :: shared_ptr的应具有相同的行为。

std::shared_ptr is the C++0x form of tr1::shared_ptr, and boost's boost::shared_ptr should behave the same.

然而,的std :: shared_ptr的,以符合的C ++ 0x标准的实现,应该/可能对更多便利的行为 shared_ptr的类,如下面的链接描述:

However, std::shared_ptr, in an implementation that conforms to C++0x standard, should/might have more convenience behavior on the shared_ptr class, as described in the following links:


  • <一个href=\"http://stackoverflow.com/questions/1086798/differences-between-different-flavours-of-shared-ptr\">Differences shared_ptr的

<一个href=\"http://en.wikipedia.org/wiki/C%2B%2B0x#General-purpose_smart_pointers\">http://en.wikipedia.org/wiki/C%2B%2B0x#General-purpose_smart_pointers

的shared_ptr 是充当尽量像一个普通的C ++数据指针引用计数指针。该TR1实现某些缺乏指针功能,如抗锯齿和指针算法,但C ++ 0x中的版本将添加这些。

The shared_ptr is a reference-counted pointer that acts as much as possible like a regular C++ data pointer. The TR1 implementation lacked certain pointer features such as aliasing and pointer arithmetic, but the C++0x version will add these.

虽然从快速粗略地看一眼,我没有看到运营商+ 和类似的算术运算的的shared_ptr 键入。

Though from a quick cursory glance, I do not see operator+ and similar arithmetic operations on the shared_ptr type.

这篇关于内存&GT;的boost ::从标准&LT的shared_ptr和std :: shared_ptr的区别;文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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