Boost logo

Boost Users :

Subject: Re: [Boost-users] [smart_ptr] weak_ptr pointer semantics
From: Szymon Gatner (szymon.gatner_at_[hidden])
Date: 2011-11-12 04:47:11


>
> No, it isn't.
>
> if( shared_ptr<> p = weak.lock() )
> {
>   p->thisWillNotAssert();
> }
>
> expired() should only be used for positive tests: if( weak.expired() ). Once
> a weak_ptr expires, it stays expired, so there is no potential for a race.

So that is a "no" on a get() thing? ;)

Regards,
Simon


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net