
On Nov 29, 2006, at 11:07 AM, Peter Dimov wrote:
Howard Hinnant wrote:
* It has cute syntax to safely handle arrays: unique_ptr
. * You can also customize the storage type (defaults to T*) by giving your deleter an optional D::pointer type. Do you have a rationale/use cases for D::pointer and unique_ptr
?
Not written up.
But D::pointer was put in in an attempt to support shared memory. In
this use case you really need a smart pointer instead of a T*. This
use case hasn't been tested with actual code. However the feature is
about as free as it gets. It consumes no code size or run time. And
the author of D can completely ignore the pointer type and not even
provide it. unique_ptr searches D, and if pointer isn't found, uses
T*. Put this one in the "might be useful, costs nothing to provide"
category.
On unique_ptr