Boost C++ Libraries: Ticket #7205: boost1.50 unorder_map not affect shared_ptr object reference count on mac 10.8 https://svn.boost.org/trac10/ticket/7205 <p> here is the test code: </p> <p> #include &lt;iostream&gt; using namespace std; </p> <p> #include &lt;boost/smart_ptr.hpp&gt; #include &lt;boost/unordered_map.hpp&gt; </p> <p> typedef unsigned long long ulonglong; </p> <p> class test { </p> <blockquote> <p> int a; </p> </blockquote> <p> public: </p> <blockquote> <p> test(int i) : a(i) {} ~test() {} </p> </blockquote> <p> }; </p> <p> int main(int argc, const char * argv[]) { </p> <blockquote> <p> boost::unordered_map&lt;ulonglong, boost::shared_ptr&lt;test&gt; &gt; tt; boost::shared_ptr&lt;test&gt; e(new test(3)); tt.insert(make_pair(1314, e)); return 0; </p> </blockquote> <p> } </p> <p> I'm developing program under mac 10.8 with Xcode 4.4 . When using unordered_map with upper codes, boost150 will not add reference count of var e, but boost 149 works fine. </p> <p> When doing this test, I switch the include header folder of /usr/local/include/boost betweet boost150 and boost 149. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7205 Trac 1.4.3 wen max <wen.max8@…> Wed, 08 Aug 2012 03:13:32 GMT <link>https://svn.boost.org/trac10/ticket/7205#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7205#comment:1</guid> <description> <p> I've done more test about this, that I can confirm this is a bug of Apple llvm compiler . Under mac 10.8 console with g++ compile without any problem. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Wed, 08 Aug 2012 04:36:24 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7205#comment:2 https://svn.boost.org/trac10/ticket/7205#comment:2 <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">duplicate</span> </li> </ul> <p> Sorry, it's actually an unordered bug. It only happens when using a C++03 allocator with a C++11 compiler, which is why it doesn't show up for g++. It will be fixed in the new release, and there's a patch at: </p> <p> <a href="http://www.boost.org/patches/1_50_0/001-unordered.patch">http://www.boost.org/patches/1_50_0/001-unordered.patch</a> </p> <p> Closing this as a duplicate of <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7100" title="#7100: Bugs: unorderd_set&lt;shared_ptr&lt;T&gt; &gt; &gt; - insert does not increment count (closed: fixed)">#7100</a>. </p> Ticket