Opened 9 years ago
Closed 7 years ago
#9931 closed Bugs (fixed)
flat_map::insert(ordered_unique_range_t...) fails with move_iterators
Reported by: | Owned by: | Ion Gaztañaga | |
---|---|---|---|
Milestone: | To Be Determined | Component: | container |
Version: | Boost 1.55.0 | Severity: | Problem |
Keywords: | Cc: |
Description
This code asserts:
flat_map<int, std::string> m1; m1.emplace(1, "one"); m1.emplace(5, "five"); m1.emplace(3, "three");
flat_map<int, std::string> m2; m2.emplace(6, "six"); m2.emplace(7, "seven"); m2.emplace(8, "eight");
m1.insert(
boost::container::ordered_unique_range_t(), std::make_move_iterator(std::begin(m2)), std::make_move_iterator(std::end(m2)));
insert() accesses the iterator multiple times, trying to determine if it can insert a range of values in a burst.
Change History (6)
comment:1 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 8 years ago
It doesn't seem to be fixed in boost 1.57.0, the example code still asserts for me.
comment:3 by , 8 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:4 by , 8 years ago
Let me know if:
https://github.com/boostorg/container/commit/f47bf08ccc9b64da1e6afa6da8ab4e2147ecede8
solves the issue. Thanks.
comment:6 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Closing as fixed as there is no error report since the last fix.
Thanks for the report. I've reproduced it and found that due to the internal representation of flat_map using a custom pair, a conversion was triggered when dereferencing the iterator when inserting. Fixed in:
[develop 5013f3f] Fixes #9931 ("flat_map::insert(ordered_unique_range_t...) fails with move_iterators")