Boost C++ Libraries: Ticket #5119: [C++0x] unordered_map doesn't support cp-ctor. https://svn.boost.org/trac10/ticket/5119 <p> hi, </p> <p> during compiling following testcase on gcc-4.6 snapshot i get an error. </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;boost/unordered_map.hpp&gt;</span><span class="cp"></span> <span class="k">struct</span> <span class="n">S</span> <span class="p">{</span> <span class="n">boost</span><span class="o">::</span><span class="n">unordered_map</span><span class="o">&lt;</span><span class="k">const</span> <span class="kt">void</span><span class="o">*</span><span class="p">,</span> <span class="kt">int</span> <span class="o">&gt;</span> <span class="n">m_</span><span class="p">;</span> <span class="p">};</span> <span class="n">boost</span><span class="o">::</span><span class="n">unordered_map</span><span class="o">&lt;</span><span class="k">const</span> <span class="kt">void</span><span class="o">*</span><span class="p">,</span> <span class="n">S</span><span class="o">&gt;</span> <span class="n">m2_</span><span class="p">;</span> <span class="kt">void</span> <span class="nf">foo</span> <span class="p">(</span> <span class="k">const</span> <span class="kt">void</span><span class="o">*</span> <span class="n">p</span> <span class="p">)</span> <span class="p">{</span> <span class="n">S</span> <span class="n">s</span><span class="p">;</span> <span class="n">m2_</span><span class="p">.</span><span class="n">insert</span> <span class="p">(</span> <span class="n">std</span><span class="o">::</span><span class="n">make_pair</span> <span class="p">(</span> <span class="n">p</span><span class="p">,</span> <span class="n">s</span> <span class="p">)</span> <span class="p">);</span> <span class="p">}</span> </pre></div></div><pre class="wiki">(...) include/c++/4.6.0/bits/stl_pair.h:110:17: error: 'constexpr std::pair&lt;_T1, _T2&gt;::pair(const std::pair&lt;_T1, _T2&gt;&amp;) [with _T1 = const void* const, _T2 = S, std::pair&lt;_T1, _T2&gt; = std::pair&lt;const void* const, S&gt;]' is implicitly deleted because the default definition would be ill-formed: .../include/c++/4.6.0/bits/stl_pair.h:110:17: error: use of deleted function 'S::S(const S&amp;) </pre><p> the major problem is a lack of copy constructor in unordered_map when compiled with -std=gnu++0x. the !defined(BOOST_NO_RVALUE_REFERENCES) activates only move semantics while documentation describes cp-ctor. <a href="http://www.boost.org/doc/libs/1_45_0/doc/html/boost/unordered_map.html#id1354372-bb">http://www.boost.org/doc/libs/1_45_0/doc/html/boost/unordered_map.html#id1354372-bb</a> </p> <p> GCC bugzilla entry about this issue: <a class="ext-link" href="http://gcc.gnu.org/PR47417"><span class="icon">​</span>http://gcc.gnu.org/PR47417</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5119 Trac 1.4.3 Daniel James Tue, 25 Jan 2011 20:14:02 GMT <link>https://svn.boost.org/trac10/ticket/5119#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5119#comment:1</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/68445" title="Add copy constructors and assignment operators when using rvalue ...">[68445]</a>) Add copy constructors and assignment operators when using rvalue references. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5119" title="#5119: Bugs: [C++0x] unordered_map doesn't support cp-ctor. (closed: fixed)">#5119</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Tue, 25 Jan 2011 20:23:30 GMT</pubDate> <title>status, milestone changed https://svn.boost.org/trac10/ticket/5119#comment:2 https://svn.boost.org/trac10/ticket/5119#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.47.0</span> </li> </ul> <p> That will hopefully fix it, but it's too late for 1.46. </p> <p> I'm still seeing a lot of failures for gcc 4.6, but they also show up on gcc 4.5 and all seem to be exception related. Since they're not showing up on the regression tests, I suspect this is a problem with the macports version of gcc rather than a bug in boost or gcc in general. </p> Ticket Denis Arnaud <denis.arnaud_boost@…> Thu, 24 Feb 2011 22:48:21 GMT cc set https://svn.boost.org/trac10/ticket/5119#comment:3 https://svn.boost.org/trac10/ticket/5119#comment:3 <ul> <li><strong>cc</strong> <span class="trac-author">denis.arnaud_boost@…</span> added </li> </ul> Ticket Daniel James Wed, 02 Mar 2011 08:48:20 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5119#comment:4 https://svn.boost.org/trac10/ticket/5119#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</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/69469" title="Add copy constructors and assignment operators when using rvalue ...">[69469]</a>) Add copy constructors and assignment operators when using rvalue references. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5119" title="#5119: Bugs: [C++0x] unordered_map doesn't support cp-ctor. (closed: fixed)">#5119</a>. </p> Ticket