
26 Apr
2008
26 Apr
'08
4:34 p.m.
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