Boost C++ Libraries: Ticket #2554: shared_ptr initialized with NULL returns use_count() == 1 https://svn.boost.org/trac10/ticket/2554 <p> After creating shared_ptr with NULL initial value, it returns use_count() == 1: </p> <p> shared_ptr&lt;int&gt; p(NULL); cout &lt;&lt; p.use_count() &lt;&lt; endl; </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2554 Trac 1.4.3 Steven Watanabe Thu, 04 Dec 2008 03:05:27 GMT component changed; owner set https://svn.boost.org/trac10/ticket/2554#comment:1 https://svn.boost.org/trac10/ticket/2554#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Peter Dimov</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">smart_ptr</span> </li> </ul> Ticket Frank Mori Hess Fri, 19 Dec 2008 14:55:05 GMT <link>https://svn.boost.org/trac10/ticket/2554#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2554#comment:2</guid> <description> <p> This isn't a bug. You've created a "null" shared_ptr, which is different from an "empty" shared_ptr. Only an "empty" shared_ptr has a use_count of zero. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Sat, 28 Feb 2009 17:06:03 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2554#comment:3 https://svn.boost.org/trac10/ticket/2554#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> Ticket