Boost logo

Boost :

From: Oleg Fedtchenko (BoostOleg_at_[hidden])
Date: 2004-10-14 09:55:08

>> Oleg Fedtchenko wrote:
>> Another thing is that it's impossible to use custom add_ref() and
>> release() for an owner the way it is done in intrusive_ptr. I mean
>> a developer of a class must choose one of the shared_ptr and
>> intrusive_ptr (if the last is extended to support a smart member
>> pointers). But we want this class to be used inside owner of any
>> type. And one owner will live with just *delete me* but another
>> owner will require *let me do some processing and then delete me
>> myself*.

> Larry Evans wrote:
> Can't *let me do some processing and then delete me
> myself* be done with a custom deleter argument to shared_ptr?
> I.e. with the CTOR:
> template<class Y, class D> shared_ptr(Y * p, D d): px(p), pn(p, d)
> {
> detail::sp_enable_shared_from_this( pn, p, p );
> }

Ok. Agree. But what about custom add_ref()?

Oleg Fedtchenko

recommended thread entry

Boost list run by bdawes at, gregod at, cpdaniel at, john at