Section

std::auto_ptr

auto_ptr is a smart pointer that manages an object obtained via new expression and deletes that object when auto_ptr itself is destroyed. It may be used to provide exception safety for dynamically allocated objects, for passing ownership of dynamically allocated objects into functions and for returning dynamically allocated objects from functions.

# Declarations

template< class T > class auto_ptr;

(deprecated in C++11) (removed in C++17)

template<> class auto_ptr<void>;

(deprecated in C++11) (removed in C++17)