自动指针类
auto_ptr is a class template available in the C++ Standard Library (declared in the <memory> header file) that provides some basic RAII features for C++ raw pointers.The auto_ptr template class describes an object that stores a pointer to a single allocated object of type Type* that ensures that the object to which it points gets destroyed automatically when control leaves a scope.The shared_ptr template class defined in C++11, and available in the Boost library, can be used as an alternative to auto_ptr for collections with ownership semantics.The current C++ standard, C++11, made auto_ptr deprecated, replacing it with the unique_ptr class template.