
26 Apr
2008
26 Apr
'08
12:45 p.m.
Daniel Frey:
I refactored enable_shared_from_this in order to remove the _owner flag.
To test it, you need a small and straight-forward addition to detail::weak_count: It needs .empty(), similar to detail::shared_count.
Are you sure that you need to test for emptiness instead of expiration? X x; // derives from esft shared_ptr<X> p1( &x, null_deleter() ); p1->shared_from_this(); // OK p1.reset(); shared_ptr<X> p2( &x, null_deleter() ); p2->shared_from_this(); // ??