Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-02-11 12:07:47


From: "Darin Adler" <darin_at_[hidden]>
> On 2/11/02 8:47 AM, "Peter Dimov" <pdimov_at_[hidden]> wrote:
>
> > Performance aside, I have to admit that the right design is probably to
> > allow weak->shared conversions (and not much else.)
>
> If the current implementation really doesn't work multi-threaded, then
> perhaps we should bite the bullet and:
>
> 1) change documentation to say weak_ptr doesn't work with multiple
> threads
> 2) change weak_ptr interface so you make a shared_ptr from it, and
> remove other operations like *, get(), and ->

If we do (1), there is no need to remove the other operations. They are
perfectly safe in single threaded programs.

If we have to bite the bullet, we should do (2) and make it work with
multiple threads. How to do that without penalizing shared_ptr users that
don't use weak_ptr is not yet clear to me, though.


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