A unique pointer is an object that owns another object and
manages that other object through a pointer.
More precisely, a unique pointer
is an object u that stores a pointer to a second object p and
will dispose of p when u is itself destroyed (e.g., when
leaving block scope ([stmt.dcl])).
The mechanism by which u disposes of p is known as
p's associated deleter, a function object whose correct
invocation results in p's appropriate disposition (typically its deletion).
Let the notation u.p denote the pointer stored by u, and
let u.d denote the associated deleter.
Upon request, u can
reset (replace) u.p and u.d with another pointer and
deleter, but properly disposes of its owned object via the associated
deleter before such replacement is considered completed.
Each object of a type U instantiated from the unique_ptr template
specified in [unique.ptr] has the strict ownership semantics, specified above,
of a unique pointer.
The uses
of unique_ptr include providing exception safety for
dynamically allocated memory, passing ownership of dynamically allocated
memory to a function, and returning dynamically allocated memory from a
function.