Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2003-04-03 09:15:29


On Thursday, April 3, 2003, at 05:04 AM, Peter Dimov wrote:

> So if someone has an opinion about this potential change to
> scoped_ptr, now
> is probably the right time to express it.

I've been experimenting with:

template<class T, class D = detail::apply_delete>
class move_ptr;

So far I like it. It is implemented so that the deallocator can also
be a reference to a deallocator. Can be used like:

template<class T>
template<class Y, class D>
shared_ptr<T>::shared_ptr(Y* p, D d)
        : ptr_(p)
{
        move_ptr<Y, D&> hold(p, d);
        s_ = new detail::shared_ptr_deleter<Y, D>(p, d);
        hold.release();
        ...
}

-Howard


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