I was wondering if there are any differences between the boost::shared_ptr and the std::shared_ptr found in the standard <memory> file.
1 Answer
std::shared_ptr is the C++0x form of tr1::shared_ptr, and boost's boost::shared_ptr should behave the same.
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:
The
shared_ptris 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.
Though from a quick cursory glance, I do not see operator+ and similar arithmetic operations on the shared_ptr type.
1 Comment
std::shared_ptr and boost::shared_ptr behaves the same. Right?
std::shared_ptris the C++0x form oftr1::shared_ptr, and boost'sshared_ptrshould behave the same: stackoverflow.com/questions/3831572/…