
On Tue, Mar 25, 2008 at 8:55 PM, Frank Mori Hess <fmhess@speakeasy.net> wrote:
I just want to point out that even with the fix that went in today, the behavior of enable_shared_from_this::shared_from_this when multiple shared_ptrs take independent ownership is inconsistent with the old behavior. The old behavior was that shared_from_this would return a shared_ptr that shared ownership with whichever shared_ptr took ownership of the object last. The new behavior is shared_from_this always returns a shared_ptr that shares ownership with the first shared_ptr to take ownership of the object. The attached example illustrates the difference when compiled against the old lib and svn trunk.
I don't want to make a big deal of this, as I actually think the new behavior is more sane, but I thought I should point it out. My preferred solution would be to just point out the change in the next release notes or something like that.
What happens if two different deleters are used to create different shared_ptrs (on the same object) ? Does this happens with only shared_from_this inherited classes or for all types?
-- Frank
-- Felipe Magno de Almeida