
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 30 April 2008 17:21, Frank Mori Hess wrote:
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".
To be clear what I'm talking about, I've implemented a little proof of concept of "shared_from_that" and "enable_shared_from_that", and a little test program. - -- Frank -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIGSRB5vihyNWuA4URAn3QAKDcxbahawcYUr5mAH6KRRPT29zaoQCfTi0e izDdZ98Cpi5PPr3D1nk0E8k= =HHfh -----END PGP SIGNATURE-----