Boost logo

Boost :

From: Darin Adler (darin_at_[hidden])
Date: 2002-02-11 11:53:12


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 ->
    3) for the thread-safe version either:
        a) leave it until we have the policy-based smart pointer
        b) add it controlled by some sort of ifdef

The current state is strange, because we chose the current class interface
in part because of the difficulty of making a thread-safe conversion to
shared_ptr, but people have pointed out that there's no thread-safe way to
use the current one anyway.

What do you say, Peter?

    -- Darin


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