Boost logo

Boost :

From: Emil Dotchevski (emil_at_[hidden])
Date: 2008-04-29 18:38:41

On 4/29/08, Daniel Frey <d.frey_at_[hidden]> wrote:
> I tried to do this and found one thing that I cannot do with the current
> implementation of weak_ptr: I cannot test if it's empty. It lacks the
> conversion to bool, similar to shared_ptr. Or is there any way to do
> this I missed?
If you have an empty weak_ptr<foo> e, and another weak_ptr<foo> a,
which you need to test for emptiness, you can use !(e<a) && !(a<e).

Emil Dotchevski
Reverge Studios, Inc.

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