Boost logo

Boost :

From: Greg Colvin (gregory.colvin_at_[hidden])
Date: 2003-04-03 05:20:19


I think scoped_ptr needs to remain as it is. If we need this
functionality a new scoped_deallocator may be the way to go.

On Thursday, Apr 3, 2003, at 11:04 Europe/London, Peter Dimov wrote:

> Lars Gullik Bjønnes wrote:
>> We find ourselves in want of a custom deallocator for scoped_ptr, but
>> no such thing seems to exist now.
>>
>> Has this been thought of?
>>
>> If yes, what was the reason for not supporting this?
>
> If you want a shared_ptr-style runtime custom deallocator support,
> this is
> not supported because the overhead was (and is) considered
> unacceptable for
> scoped_ptr. Use shared_ptr instead.
>
> The alternative is
>
> template< class T, class D = boost::checked_deleter<T> > class
> scoped_ptr
> {
> public:
>
> // ...
>
> ~scoped_ptr() { D()(ptr); }
> };
>
> The concern here is that the change may potentially break user code
> that
> uses a template template parameter to pass
> scoped_ptr/auto_ptr/shared_ptr/whatever_ptr as an argument.
>
> I'm not yet sure whether the increased functionality justifies
> breaking such
> code. OTOH I'm not sure whether such code even exists. ;-)
>
> So if someone has an opinion about this potential change to
> scoped_ptr, now
> is probably the right time to express it.
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk