Differences between different flavours of shared_ptr

后端 未结 1 411
不思量自难忘°
不思量自难忘° 2020-12-17 10:33

Are there any differences between boost::shared_ptr, std::tr1::shared_ptr and the upcoming (in C++0x) std::shared_ptr?

Will po

相关标签:
1条回答
  • 2020-12-17 11:11

    According to the Boost website, the boost::shared_ptr...

    ...conforms to the TR1 specification, with the only exception that it resides in namespace boost instead of std::tr1.

    According to the Wikipedia C++0x page

    The TR1 implementation lacked certain pointer features such as aliasing and pointer arithmetic, but the C++0x version will add these.

    If your code works with the TR1/Boost version, it should work with the C++0x version (but not necessarily vice versa).

    0 讨论(0)
提交回复
热议问题