Header: "boost/shared_array.hpp"shared_array is a smart pointer that enables shared ownership of arrays. It is to shared_ptr what scoped_array is to scoped_ptr. shared_array differs from shared_ptr mainly in that it is used with arrays rather than a single object. When we discussed scoped_array, I mentioned that std::vector was often a better choice. But shared_array adds some value over vector, because it offers shared ownership of arrays. The shared_array interface is similar to that of shared_ptr, but with the addition of a subscript operator and without support for custom deleters. Because a shared_ptr to std::vector offers much more flexibility than shared_array, there's no usage section on shared_array in this chapter. If you find that you need boost::shared_array, refer to the online documentation. |