From: Lie-Quan Lee (llee1_at_[hidden])
Date: 2001-04-06 14:03:05
At Thu, 5 Apr 2001 16:46:23 -0600,
Greg Colvin wrote:
> 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.
Currently I modified the shared_ptr to serve my purpose. But I would
like to see your version (It is fine to me that it is not boostified
-- Lie-Quan Lee
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk