Boost logo

Boost :

From: Darin Adler (darin_at_[hidden])
Date: 2002-01-26 23:24:52


On 1/26/02 2:59 PM, scleary_at_[hidden] wrote:

> If you (or the user) don't want to create a separate policy plugin for each
> type of releasable resource, we might want to consider providing (as part of
> Boost, I mean) a shared/scoped_ptr<> that calls a function<void> on
> destruction. This would also be helpful in other situations.

That's almost exactly what Peter's new shared_ptr has. But it doesn't use a
function<void>, instead it takes any object, d, that can be invoked as

    d(x)

where x is the T* managed by shared_ptr.

I can imagine people wanting this in scoped_ptr too, but Peter didn't take
that on yet, in part because adding any additional overhead for scoped_ptr
is far more controversial than adding a bit of overhead to shared_ptr.

    -- Darin


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