Subject: [Boost-bugs] [Boost C++ Libraries] #5119: [C++0x] unordered_map doesn't support cp-ctor.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-01-25 13:52:52
#5119: [C++0x] unordered_map doesn't support cp-ctor.
------------------------------+---------------------------------------------
Reporter: pluto@⦠| Owner: danieljames
Type: Bugs | Status: new
Milestone: To Be Determined | Component: unordered
Version: Boost 1.45.0 | Severity: Problem
Keywords: |
------------------------------+---------------------------------------------
hi,
during compiling following testcase on gcc-4.6 snapshot i get an error.
{{{#!c++
#include <boost/unordered_map.hpp>
struct S
{
boost::unordered_map<const void*, int > m_;
};
boost::unordered_map<const void*, S> m2_;
void foo ( const void* p )
{
S s;
m2_.insert ( std::make_pair ( p, s ) );
}
}}}
{{{
(...)
include/c++/4.6.0/bits/stl_pair.h:110:17:
error: 'constexpr std::pair<_T1, _T2>::pair(const std::pair<_T1, _T2>&)
[with _T1 = const void* const, _T2 = S, std::pair<_T1, _T2>
= std::pair<const void* const, S>]' 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&)
}}}
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.
http://www.boost.org/doc/libs/1_45_0/doc/html/boost/unordered_map.html#id1354372-bb
GCC bugzilla entry about this issue: http://gcc.gnu.org/PR47417
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5119> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC