Boost C++ Libraries: Ticket #810: support for weak_ptr binding https://svn.boost.org/trac10/ticket/810 <pre class="wiki">Hello, recently i faced with problem - i was not able to pass weak_ptr to bind() function. I started to study why and found there is no support for this in boost. As result, me and my friend wrote "get_pointer" version which accepts weak_ptr. At actual call moment, implementation uses weak_ptr::lock() to get shared_ptr. If retrieved shared_ptr is invalid, then exception of type "disposed_exception" thrown. This code was tested on Windows XP SP2 with following compilers: VC6, VC7, VC7.1, VC8, g++ 3.2.3 (MinGW), g++ 3.4.4 (Cygwin). If you find this code is useful for someone else me, please add to boost (it's actually not a library, this is why i'm poosting it to "patches"). You can find sources + test app in attachment. Thank you, Dmytro Gokun </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/810 Trac 1.4.3 btmore@… Thu, 05 Jul 2007 12:42:45 GMT <link>https://svn.boost.org/trac10/ticket/810#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/810#comment:1</guid> <description> <p> Are there any plans to add this type of functionality? </p> <p> This would be very useful in my current project, but I'd rather stick with upstream instead of patching boost locally. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Sat, 07 Jul 2007 17:39:09 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/810 https://svn.boost.org/trac10/ticket/810 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">bind_weak_ptr.zip</span> </li> </ul> Ticket Peter Dimov Sat, 07 Jul 2007 17:40:21 GMT type changed; severity, milestone set https://svn.boost.org/trac10/ticket/810#comment:2 https://svn.boost.org/trac10/ticket/810#comment:2 <ul> <li><strong>type</strong> <span class="trac-field-old">Patches</span> → <span class="trac-field-new">Feature Requests</span> </li> <li><strong>severity</strong> → <span class="trac-field-new">Optimization</span> </li> <li><strong>milestone</strong> → <span class="trac-field-new">To Be Determined</span> </li> </ul> <p> Moved to Feature Requests, restored attachment. </p> Ticket andy@… Thu, 04 Oct 2007 20:39:57 GMT <link>https://svn.boost.org/trac10/ticket/810#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/810#comment:3</guid> <description> <p> For what it's worth, I second the request for this functionality. I was thinking about attempting to write a version myself for submission when I stumbled across this trac entry. I think that this form of bind would be extremely useful. I can't think of a nicer generic way to break a shared_ptr dependency while still maintaining decoupling using boost bind and function. </p> </description> <category>Ticket</category> </item> <item> <author>Jonathan Wakely <jwakely.boost@…></author> <pubDate>Mon, 08 Jun 2009 15:30:02 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/810#comment:4 https://svn.boost.org/trac10/ticket/810#comment:4 <ul> <li><strong>cc</strong> <span class="trac-author">jwakely.boost@…</span> added </li> </ul> Ticket joseph.j.mudnackal@… Mon, 23 May 2011 16:03:40 GMT <link>https://svn.boost.org/trac10/ticket/810#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/810#comment:5</guid> <description> <p> is this feature gonna be added anytime soon? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Wed, 11 Dec 2013 22:00:10 GMT</pubDate> <title>status, description changed https://svn.boost.org/trac10/ticket/810#comment:6 https://svn.boost.org/trac10/ticket/810#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">new</span> </li> <li><strong>description</strong> modified (<a href="/trac10/ticket/810?action=diff&amp;version=6">diff</a>) </li> </ul> Ticket