Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2007-09-28 10:36:51


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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net