|
Boost : |
From: Jaap Suter (boost_at_[hidden])
Date: 2005-07-14 00:21:56
Hi,
a weak_ptr can be said to have three states.
1. Never been assigned to (default constructed)
2. Assigned to, lock will return a shared_ptr to a valid object.
3. Assigned to, but the object pointed to is dead and lock will return null.
As far as I know it is currently impossible to distinguish between case 1
and 3. Am I overlooking something? If not, can somebody explain the reason
why it is not possible to distinguish the two cases? Admittedly, I cannot
come up with any elegant design in which such a distinction is useful, so
the question is merely theoretical.
Thanks,
Jaap Suter
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk