Opened 11 years ago
Closed 11 years ago
#6311 closed Bugs (fixed)
Broken const-ref semantics
Reported by: | Owned by: | Ion Gaztañaga | |
---|---|---|---|
Milestone: | To Be Determined | Component: | move |
Version: | Boost 1.48.0 | Severity: | Regression |
Keywords: | Cc: |
Description
in Boost 1.48, unordered_maps seem to have lost the semantics of constrefs that "enl4rge your object lifetime".
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 MacPorts.
clang++ 2.1 $ /tmp/foo.clang make_map: size: 2, bar => BAR, foo => FOO return_map: size: 2, bar => BAR, foo => FOO main: size: 2, bar => BAR, foo => FOO g++ 4.2 $ /tmp/foo.gcc make_map: size: 2, bar => BAR, foo => FOO return_map: size: 0 main: size: 0
Attachments (1)
Change History (4)
by , 11 years ago
comment:2 by , 11 years ago
Component: | unordered → move |
---|---|
Owner: | changed from | to
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).
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.
comment:3 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Demonstrate the bug