C/C++
pointer.txt
Associated article: Pointer Containers
Tags: C/C++
Published source code accompanying the article by Thorsten Ottosen in which he examines smart containers--useful, safe utilities that can lead to flawless object-oriented programming. Also see POINTER.ZIP.
Pointer Containers
by Thorsten Ottosen
Listing One
(a)
typedef vector< boost:: shared_ptr<T> > ptr_vector;
(b)
template< class T >
class ptr_vector
{
std::vector<T*> vec_;
public:
~ptr_vector(); // delete objects
// ... ...


