Boost logo

Boost :

From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2005-04-02 19:30:02


"Marcin Kaliciñski" wrote:

> Smart pointers in boost work on a principle of preventing object
> destruction while references to it exist anywhere in the system. It causes
> that whoever owns a boost::shared_ptr to some object, has power to decide
> for how long will that object live. This is "ownership".
>
> In some situations it would be more convenient if object itself decided
> when to die (owned itself?), and notified all reference holders about this
> fact, so that they not try to use it any more.
>
Could you compare it to smart_ptr/weak_ptr combination?

/Pavel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk