Boost C++ Libraries: Ticket #6311: Broken const-ref semantics https://svn.boost.org/trac10/ticket/6311 <p> in Boost 1.48, unordered_maps seem to have lost the semantics of constrefs that "enl4rge your object lifetime". </p> <p> The following runs are on a Mac OS X Lion, native clang++ 2.1 and native G++ 4.2. The latter is completely wrong. It used to be correct. Boost 1.48 installed via <a class="missing wiki">MacPorts</a>. </p> <pre class="wiki">clang++ 2.1 $ /tmp/foo.clang make_map: size: 2, bar =&gt; BAR, foo =&gt; FOO return_map: size: 2, bar =&gt; BAR, foo =&gt; FOO main: size: 2, bar =&gt; BAR, foo =&gt; FOO g++ 4.2 $ /tmp/foo.gcc make_map: size: 2, bar =&gt; BAR, foo =&gt; FOO return_map: size: 0 main: size: 0 </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6311 Trac 1.4.3 Akim Demaille <akim.demaille@…> Wed, 21 Dec 2011 14:55:20 GMT attachment set https://svn.boost.org/trac10/ticket/6311 https://svn.boost.org/trac10/ticket/6311 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">foo.cc</span> </li> </ul> <p> Demonstrate the bug </p> Ticket Akim Demaille <akim.demaille@…> Wed, 21 Dec 2011 15:06:19 GMT <link>https://svn.boost.org/trac10/ticket/6311#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6311#comment:1</guid> <description> <p> Using G++ 4.6 (from the <a class="missing wiki">MacPorts</a> too), it works as expected. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Mon, 02 Jan 2012 09:21:37 GMT</pubDate> <title>owner, component changed https://svn.boost.org/trac10/ticket/6311#comment:2 https://svn.boost.org/trac10/ticket/6311#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Daniel James</span> to <span class="trac-author">Ion Gaztañaga</span> </li> <li><strong>component</strong> <span class="trac-field-old">unordered</span> → <span class="trac-field-new">move</span> </li> </ul> <p> Sorry for the slow response, I only just got round to looking into this. It seems to be the case for any moveable classes implemented using Boost.Move so I'm reassigning this. It does appear to be a bug in g++ 4.2 (it's also present in g++ 4.0, but not in g++ 4.4 or later). </p> <p> Boost.Move seems to be a bit too quirky, so I think I'm only going to implement the containers using Boost.Move if a macro is defined to opt in. Will still use Boost.Move for the elements. </p> Ticket Daniel James Sun, 15 Jan 2012 20:22:18 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6311#comment:3 https://svn.boost.org/trac10/ticket/6311#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">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/76531" title="Unordered: Merge move changes. Fixes #6311. ">[76531]</a>) Unordered: Merge move changes. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6311" title="#6311: Bugs: Broken const-ref semantics (closed: fixed)">#6311</a>. </p> Ticket