28 Sep
2007
28 Sep
'07
2:36 p.m.
Zeljko Vrba wrote:
On Fri, Sep 28, 2007 at 03:39:31PM +0300, Peter Dimov wrote:
In practice, it's rare for the user to want to use a custom allocator for the control block, yet not use a custom allocator for the object, so forcing him to pass a deleter as well is not as constraining.
But isn't overloading of new/delete the "usual" way of implementing a custom allocator for a class? In that case, an ordinary "delete" will deallocate the class properly (hence my question about standard deleter class).
The latest draft (N2369) has default_delete in the unique_ptr section (20.6.5.1). I'd have named it default_deleter though. :-) Boost has checked_deleter that's pretty much identical.