Boost logo

Boost :

From: Greg Colvin (gcolvin_at_[hidden])
Date: 2001-04-05 17:46:23


From: Lie-Quan Lee <llee1_at_[hidden]>
>
> I am running into a situation that I want a reference-counting pointer
> but when the counter goes to zero, I want do something based on that
> pointer before the contained pointer get deleted. One implementation
> could be shared_ptr takes the second template argument (function
> object). Then, the function object gets invoked before the contained
> pointer is deleted.
>
> I am wondering if the situation I run into is common to other people
> or not. If it is quite common, it would be better that boost could
> modify shared_ptr. Otherwise, it might not worthy.
>
> Or there is other better solution to my situation?

I have a version of shared_ptr that takes an optional
deletion funtion or function object, but haven't had
time to boostify it.


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