Question: what is the difference between auto_ptr and unique_ptr?
Answer: They all are declared in a memory header file. This class template is deprecated as of C++11. unique_ptr is a new facility with a similar functionality, but with improved security. auto_ptr is a smart pointer that manages an object obtained via new expression and deletes that object when auto_ptr itself is destroyed.