Opened 7 years ago
Closed 6 years ago
#11829 closed Bugs (fixed)
Order of elements with same key in multimap not preserved
Reported by: | Owned by: | Robert Ramey | |
---|---|---|---|
Milestone: | To Be Determined | Component: | serialization |
Version: | Boost 1.59.0 | Severity: | Problem |
Keywords: | Cc: |
Description
The hinting in load_map_collection from boost/serialization/map.hpp destroys the relative order of elements with the same key. Since C++11 one can reconstruct multimaps where the elements preserve the original order. However, one has to use the multimap insertions without hinting. A quick fix would be to drop hinting for multimaps whereas for maps it can still be used. Possibly also hinting with the end pointer would work.
Attachments (2)
Change History (3)
by , 7 years ago
by , 7 years ago
A simple workaround, where hinting is dropped for multimaps.
comment:1 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I'm pretty sure I've fixed this but forget about it. Please check boost 1.61
Note:
See TracTickets
for help on using tickets.
Minimum working example demonstrating bug. The relative order of the elements with the same key is destroyed when restoring the multimap.