Modify

Opened 7 years ago

Closed 7 years ago

#5119 closed Bugs (fixed)

[C++0x] unordered_map doesn't support cp-ctor.

Reported by: pluto@… Owned by: Daniel James
Milestone: Boost 1.47.0 Component: unordered
Version: Boost 1.45.0 Severity: Problem
Keywords: Cc: denis.arnaud_boost@…

Description

hi,

during compiling following testcase on gcc-4.6 snapshot i get an error.

#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

Attachments (0)

Change History (4)

comment:1 Changed 7 years ago by Daniel James

(In [68445]) Add copy constructors and assignment operators when using rvalue references. Refs #5119.

comment:2 Changed 7 years ago by Daniel James

Milestone: To Be DeterminedBoost 1.47.0
Status: newassigned

That will hopefully fix it, but it's too late for 1.46.

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.

comment:3 Changed 7 years ago by Denis Arnaud <denis.arnaud_boost@…>

Cc: denis.arnaud_boost@… added

comment:4 Changed 7 years ago by Daniel James

Resolution: fixed
Status: assignedclosed

(In [69469]) Add copy constructors and assignment operators when using rvalue references. Fixes #5119.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Daniel James.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.