mirror of
https://github.com/boostorg/unordered.git
synced 2026-02-16 13:52:14 +00:00
28f529100dfa34571a9d88e1ab8a4c23511b14d5
C++17 requires that unordered_map has the same type of node as unordered_multimap, and that unordered_set has the same type of node as unordered_multiset. This didn't seem particularly useful to me and contradicts the old implementation which had different nodes, I put a lot of effort into trying to abstract out the difference and make it selectable using a macro, so that the old implementation would still by available for anyone who doesn't care about strict compatibility. But I think that was a mistake, it was making things too complicated and for too little gain. The default would still be inefficient containers for equivalent keys, and using the macro could lead to problems down the line. So I've switched to using a much simpler implementation which just marks the first node in a group of equivalent nodes. This isn't as fast when there are a lot of elements with equivalent keys - it can't skip to the end of a group of nodes, but at least it avoids having to do a lot of potentially expensive comparisons. It's also a lot closer to the intent of the standard, even if I disagree with that intent.
Description
Languages
C++
98.6%
Python
0.8%
CMake
0.5%