If a program attempts to assign one unique_ptr to another. The compiler
allows it if the source object is a temporary rvalue and disallows it if the
source object has some duration:
You can store unique_ptr objects in an STL container providing you don’t
invoke methods or algorithm, such as copy(), that copy or assign one
unique_ptr to another. see effective stl item 8.
If the program uses more than one pointer to an object, shared_ptr is
your choice. Such as you have two objects that contain pointers
to the same third object. Or you may have an STL container of
pointers.