
-----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.
How uncomfortable are you with it? I might try to implement the "reserved" weak_ptr idea, if I can add some way to distinguish between "expired and reserved" and plain old "expired". lock() could return an empty shared_ptr with a non-null stored pointer for a "reserved" weak_ptr? That's probably too evil. A "bool reserved() const" member function? - -- Frank -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIHxuZ5vihyNWuA4URArg+AJ0ajvwRvM1NAbqK6n75Jzyr2RcWbwCbBY4r NJBgshMzI4HI8LscV7qUuFk= =CBph -----END PGP SIGNATURE-----