std::auto_ptr - deprecated, deprecated implementation of exclusive right to a pointer. It has been replaced by std::unique_ptr in C ++ 11. Exclusive ownership means that the pointer belongs to something, and the lifetime of the object is tied to the lifetime of the owner.
Shared pointers ( std::shared_ptr ) implement pointer sharing - they keep the object alive as long as there are live links to it, because there are no owners. This is usually done with reference counting, which means they have extra run-time overhead rather than unique pointers. Also, the discussion of joint ownership is more complicated than the discussion of exclusive ownership - the point of destruction becomes less deterministic.
A smart pointer is a term that encompasses all types that behave like pointers, but with added (smart) semantics, unlike raw T* . Both unique_ptr and shared_ptr are smart pointers.
Cat plus plus
source share