There are different varieties of managed pointers. The simplest is std::auto_ptr although it is limited in its use and boost::scoped_ptr is probably better for the purpose.

Smart-pointers generally take care of the deletion of the pointer after use, so you actually call new but don't call a matching delete.

- Scoped pointers are simply held by one smart-pointer object and are the pointer is deleted at the same time as the object. Scoped pointers cannot be copied, they can be reseated but using reset() to another pointer, not operator=() (either to a pointer or a scoped pointer). You might be able to do a "swap" between scoped pointers.

- Shared pointers use reference counting. Two shared-pointers can point to the same object. They are useful in collections and as return values from functions. Beware though if you use them as a class member that when your class is copied the copy gets a copy of the shared-pointer but they both point to the same object.

- COW pointers (copy-on-write) also use reference-counting as above, but if there are 2 or more instances and someone tries to modify the pointer, then the object will be "cloned".

Beware also that const shared_ptr< T > & is a const pointer, not a pointer to a const T. You can however have a shared_ptr< const T > and a good implementation of shared_ptr will allow you to copy from shared_ptr< T > to shared_ptr< const T > implicitly but not the other way round. Similarly you can copy implicitly from shared_ptr< Derived > to shared_ptr < Base > where Derived is derived from Base. boost::shared_ptr has both of these features, and also has special cast operators to convert the other way.

You may also want to give your pointer a custom deleter. boost does have shared_array (I thnk) but you don't actually need it, you can use shared_ptr with a custom deleter (that uses delete[] instead of delete). One main reason for using a custom deleter is where you have a DLL / shared-object that creates an object and you want to use a function on the same library to delete it. (Beware though of your library returning a boost::shared_ptr itself, because you and your clients might be using different versions).

boost does not (yet) offer a COW pointer (as far as I know) but I think Loki does.

I don't know about .NET but COM uses intrusive shared-pointers, and ATL provides templates for them (CComPtr).