Boost logo

Boost Users :

Subject: Re: [Boost-users] [smart_ptr] weak_ptr pointer semantics
From: Peter Dimov (pdimov_at_[hidden])
Date: 2011-11-12 07:14:09


Szymon Gatner wrote:
> > 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? ;)

It is a no. The removal of get() was intentional.


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