Boost logo

Boost :

Subject: Re: [boost] Weak functor: Interested? (How to boost::bind to aweak_ptr)
From: Peter Dimov (pdimov_at_[hidden])
Date: 2012-01-11 10:40:29

Roman Perepelitsa wrote:

> It can be done. In fact, it has already been done. See

There is also

but you'll note that it chooses to throw an exception instead. I'm still
undecided which of these two responses I prefer as default, or how to choose
the other.

There is also the use case of

void f( shared_ptr<X> p1, shared_ptr<X> p2 );

weak_ptr<X> wp1, wp2;

bind( f, wp1, wp2 );

for which the choice is between passing shared_ptr<X>(wp1) or wp1.lock() to

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