Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-05-15 06:57:23


ostware wrote:
>
> ~T needs to tell another object it holds a pointer to (say class U)
> that it is 'going away' during its destructor. T and U are loosely
> connected, from two different libraries, and each holds a weak_ptr to
> the other. When U finds out that T is 'going away' it needs to void
> out its weak_ptr<T>. I am converting code where the weak_ptrs were
> simple U* or T*.

You don't need to do anything. A weak_ptr is "voided" automagically when its
object (managed by a shared_ptr) goes away. ;-)


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net