1.scoped_ptr
scoped_ptr has similar characteristics to std::auto_ptr, with the important difference that it doesn't transfer ownership the way an auto_ptr does .
2.shared_ptr
These smart pointers eliminate the need to write complicated logic to control the lifetime of objects shared among two or more other objects. When the reference count drops to zero , no more objects are interested in the shared object, and so it is deleted automatically .
The following example shows how to store shared pointers in a Standard Library container.
当shared_ptr对象销毁时,调用指定的函数对象