Standard C++ Library Reference ISO/IEC (VERSION3)
auto_ptr::~auto_ptr
~auto_ptr();
The destructor evaluates the expression delete myptr to delete the object designated by the
stored pointer.
auto_ptr::element_type
typedef Ty element_type;
The type is a synonym for the template parameter Ty.
auto_ptr::get
Ty *get() const throw();
The member function returns the stored pointer myptr.
auto_ptr::operator=
template<class Other>
auto_ptr<Ty>& operator=(auto_ptr<Other>& right) throw();
auto_ptr<Ty>& operator=(auto_ptr<>& right) throw();
The assignment evaluates the expression delete myptr, but only if the stored pointer myptr
changes as a result of the assignment. It then transfers ownership of the pointer stored in right,
by storing right.release() in myptr. The function returns *this.
auto_ptr::operator*
Ty& operator*() const throw();
The indirection operator returns *get(). Hence, the stored pointer must not be null.
auto_ptr::operator->
Ty *operator->() const throw();
The selection operator returns get(), so that the expression ap->member behaves the same as
(ap.get())->member, where ap is an object of class auto_ptr<Ty>. Hence, the stored
pointer must not be null, and Ty must be a class, structure, or union type with a member
member.