
12 Nov
2004
12 Nov
'04
3:50 p.m.
Is it possible to reset a boost::shared_ptr without all associated boost::weak_ptr become invalid? -Dirk

12 Nov
12 Nov
4:20 p.m.
On Fri, Nov 12, 2004 at 04:50:51PM +0100, Dirk Gregorius wrote:
Is it possible to reset a boost::shared_ptr without all associated boost::weak_ptr become invalid?
AFAIK only by making another shared_ptr own the pointer. The weak_ptr becomes invalid if _no_ shared_ptr owns its pointer, but as long as one or more shared_ptrs still refer to the pointee the weak_ptr is valid. jon -- "Everything is permitted." - Fyodor Dostoyevsky, 'The Brothers Karamazov'
7515
Age (days ago)
7515
Last active (days ago)
1 comments
2 participants
participants (2)
-
Dirk Gregorius
-
Jonathan Wakely