auto_ptr was copy constructible which used to move the ownership, e.g.,
auto_ptr a;
....
auto_ptr<int> b = a; // a loses its ownership here
This can lead to confusion and bugs.
unique_ptr is not copy constructible. It is move constructible which moves the ownership, e.g.,
unique_ptr a;
....
unique_ptr<int> b = a; // ERROR, wont compile
unique_ptr<int> b = std::move(a); // OK, as programmer is explicitly moving ownership, no confusion
unique_ptr<int> b = unique_ptr(p); // OK, ownership will move from temporary unique_ptr
shared_ptr is obviously to share ownership, so:
shared_ptr a;
...
shared_ptr b = a; // both a and b have ownership, underlying pointer will only be freed when a and b both are out of scope