Boost logo

Boost :

From: Darin Adler (darin_at_[hidden])
Date: 2002-02-12 15:17:42

On 2/12/02 12:04 PM, "Peter Dimov" <pdimov_at_[hidden]> wrote:

> I don't mind removing the boolean weak_ptr queries and/or operator->, if
> that's proves a popular opinion. They are there mostly because having used
> shared_ptr, users will expect to find them in weak_ptr, too. Explaining why
> operator* isn't there is easy: it isn't thread safe, but the others are.

I think having fewer operations helps make the purpose of weak pointer
clearer. If the only thing you can do is turn one back into a strong
pointer, it becomes difficult to misuse one, and more clear what they are
for. And if a check for 0 is helpful for efficiency, we can try to choose a
name that makes it clear that false negatives are possible but false
positives are not, rather than leaving it unnamed, easy to invoke by
accident, and perhaps overpromising.

    -- Darin

Boost list run by bdawes at, gregod at, cpdaniel at, john at