
On Sep 16, 2009, at 12:10 PM, Gottlob Frege wrote:
On Wed, Sep 16, 2009 at 11:47 AM, Howard Hinnant <howard.hinnant@gmail.com> wrote:
const unique_ptr<MyClass, MyDeleter<A>> p(...);
scoped_ptr<MyClass, MyDeleter<A>> p(...);
-Howard
If you had the scoped_ptr as you described, which would you then use - const unique_ptr or scoped_ptr? My first thought is that scoped_ptr is better named, making it easier to understand for readers/maintainers. ?
I would have a slight preference for const unique_ptr because it doesn't have swap or reset. It is *really* const. Beyond that it probably wouldn't matter much as I find myself typedefing most of my uses to something more descriptive within the context I'm using it, and easier to type. E.g.: typedef const unique_ptr<node_pointer, node_allocator> node_holder; -Howard