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

_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to