|
Boost : |
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2008-04-30 17:21:05
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wednesday 30 April 2008 13:42 pm, Peter Dimov wrote:
> In principle, a new esft may avoid this by:
>
> 1. Allowing only (expired) weak_ptr instances to be created in the
> constructor;
> 2. Bringing the weak_ptr instances back to life once a shared_ptr takes
> ownership.
>
> This however seems to require a relatively major surgery to sp_counted_base
> and friends; I'm not sure I'm comfortable with that.
It sounds like you're heading in the direction of the "shared_from_that" idea
I floated earlier:
http://lists.boost.org/Archives/boost/2008/04/135372.php
which would allow client code to distinguish between the cases of "shared_ptr
not available yet" and "shared_ptr expired".
- --
Frank
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFIGOLC5vihyNWuA4URAlY7AJ992n4FL79aROGdGyZTsAA5Uv/ylACfbKmA
OZDzTSDXTOAsRCRdqU8kQnY=
=Xz99
-----END PGP SIGNATURE-----
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk