Friday, December 3, 2010


auto_ptrs cannot be used with arrays.

auto_ptrs only have one contained pointer in them. The boost library has classes that work with arrays.

The following are Boost smart pointer class templates and their corresponding header files:
scoped_ptr <class T> <boost/scoped_ptr.hpp >
scoped_array <class T> <boost/scoped_array.hpp >
shared_ptr <class T> <boost/shared_ptr.hpp >
shared_array <class T> <boost/shared_array.hpp >
weak_ptr <class T> <boost/weak_ptr.hpp >
intrusive_ptr<class T> <boost/intrusive_ptr.hpp>


No comments:

Post a Comment