|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2003-02-01 17:19:05
"David B. Held" <dheld_at_[hidden]> writes:
> "David Abrahams" <dave_at_[hidden]> wrote in message
> news:uznpfkfhe.fsf_at_boost-consulting.com...
>> [...]
>> C) Make sure the first base class of smart_ptr is the one that
>> manages destruction of its resources:
<snip>
> I was actually thinking in this direction somewhat.
Then you're getting the hang of this EH stuff; congratulations!
> I did notice that it really is the smart_ptr d'tor that really knows
> how to properly clean stuff up, and it should probably be the one to
> do so.
But coordinating cleanup in the smart_ptr dtor was causing the problem
you cited in the first place! In my version it's the ptr_manager base
class that coordinates the cleanup by encapsulating ownership and
storage.
-Dave
-- David Abrahams dave_at_[hidden] * http://www.boost-consulting.com Boost support, enhancements, training, and commercial distribution
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk