Starting with Boost release 1.53, shared_ptr can be used to hold a pointer to a dynamically allocated array. (http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/shared_ptr.htm)
Also, using shared_ptr has the benefit of allocator functions like boost::make_shared< int [] >(...);
Should I start using boost::shared_ptr instead of boost::shared_array when possible? it seems boost::shared_ptr can do most of the work boost::shared_array does.
shared_arrayis that it overrides the[]operator. Withshared_ptr<T[]>you'd need to dereference the pointer first:(*sharedPtr)[i]rather thansharedArray[i]std::vectoris often a better choice.shared_ptrhas support foroperator[]for array types, which on the other hand hasn't support foroperator->oroperator*. See boost.org/doc/libs/1_55_0/boost/smart_ptr/shared_ptr.hpp