
11 Jan
2012
11 Jan
'12
3:40 p.m.
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.