|
Boost : |
From: Greg Colvin (gcolvin_at_[hidden])
Date: 2002-02-08 22:11:52
> I just downloaded weak_ptr, and I was wondering how useful it is. What
> can you do with a weak_ptr<T> that you can't do with a plain T*?
One common use is to keep a cache of shared objects. The cache can
be implemented as a container of weak_ptr, so that just being in
the cache doesn't prevent an object from being deleted when the last
shared_ptr to the object goes away.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk