Boost C++ Libraries: Ticket #1107: Add weak_use_count to weak_ptr as a debugging aid https://svn.boost.org/trac10/ticket/1107 <p> <a class="ext-link" href="http://lists.boost.org/Archives/boost/2006/03/102620.php"><span class="icon">​</span>http://lists.boost.org/Archives/boost/2006/03/102620.php</a> </p> <blockquote> <p> This is a feature request to add weak_use_count() to weak_ptr. </p> </blockquote> <blockquote> <p> I am not interested in this feature for anything else than a debugging aid. Recently, a weakness was highlighted in one of my projects, I had stale weak_ptr objects that would remain in core even if all copies of weak and shared pointer objects should have been eliminated by now. </p> </blockquote> <blockquote> <p> To confirm the bug fix and audit the rest of the code base, a debugger was used to set a conditional break point on internal members of weak_ptr. I would rather have the ability to write assertions when needed hence weak_use_count(). </p> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1107 Trac 1.4.3 Peter Dimov Sat, 21 Jul 2007 23:20:32 GMT status changed https://svn.boost.org/trac10/ticket/1107#comment:1 https://svn.boost.org/trac10/ticket/1107#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Peter Dimov Thu, 21 Aug 2008 15:11:40 GMT milestone changed https://svn.boost.org/trac10/ticket/1107#comment:2 https://svn.boost.org/trac10/ticket/1107#comment:2 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.37.0</span> </li> </ul> Ticket Peter Dimov Sat, 28 Feb 2009 17:02:32 GMT milestone changed https://svn.boost.org/trac10/ticket/1107#comment:3 https://svn.boost.org/trac10/ticket/1107#comment:3 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.37.0</span> → <span class="trac-field-new">To Be Determined</span> </li> </ul> Ticket Jonathan Wakely <jwakely.boost@…> Mon, 08 Jun 2009 15:27:29 GMT cc set https://svn.boost.org/trac10/ticket/1107#comment:4 https://svn.boost.org/trac10/ticket/1107#comment:4 <ul> <li><strong>cc</strong> <span class="trac-author">jwakely.boost@…</span> added </li> </ul> Ticket Peter Dimov Thu, 24 Feb 2011 22:11:09 GMT status changed https://svn.boost.org/trac10/ticket/1107#comment:5 https://svn.boost.org/trac10/ticket/1107#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">new</span> </li> </ul> Ticket Carsten Neumann <carsten_neumann@…> Wed, 10 Oct 2012 19:59:56 GMT attachment set https://svn.boost.org/trac10/ticket/1107 https://svn.boost.org/trac10/ticket/1107 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">PATCH.weak_use_count.diff</span> </li> </ul> <p> weak_use_count() implementation, docs, some testing coverage </p> Ticket