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
> http://lists.boost.org/boost-users/2011/09/70647.php.

There is also

https://svn.boost.org/trac/boost/ticket/810

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
f.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk