Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-03-19 08:39:29


Frank Mori Hess:

> > Is it really that important to make the shared_ptr instances created in
> > X::X share ownership with px?
>
> It is to me, as that is my primary motivation for making this patch. If
> they didn't share ownership I wouldn't bother with it, since the plain
> old "this" pointer would do just as well.

To clarify, my question was specifically about sharing ownership. Not about
making weak pointers created from the constructor behave as expected.

After a brief consideration I think I agree with your approach, though.
Nothing better comes to mind. But it would be nice if the deleter
replacement happens only if shared_from_this has been called.

To proceed, we need two new tests. One that tests currently valid code that
will continue to work the same way, and another that tests the new behavior.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk