|
Boost : |
From: Daniel Frey (d.frey_at_[hidden])
Date: 2008-04-26 12:34:09
On Sat, 2008-04-26 at 19:10 +0300, Peter Dimov wrote:
> Given the sequence:
>
> 1. Object is created
> 2. A shared_ptr takes ownership
> 3. Owner dies
> 4. Another shared_ptr takes ownership
>
> the original esft allowed shared_from_this calls after 2 and 4, but not
> after 1 or 3. The new esft allows shared_from_this after 1 as well with the
> motivation to support calls from within the object constructor. But the
> constructor only runs once, so this motivation doesn't extend to 3.
OK, understood. The attached version should behave as expected and
passes all regression tests. It requires weak_count.empty().
Regards, Daniel
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk