Re:You can't make C++ not ugly, but you can't not try (2010)
by leetcrew on Thursday February 27, 2020 @07:38AM
(#22432685)
what's wrong with unordered_map? it's at least more useful than map.
Re:You can't make C++ not ugly, but you can't not try (2010)
by aw1621107 on Thursday February 27, 2020 @10:46AM
(#22434248)
From what I understand its API is overspecified to the point that it basically forces a "traditional" array-of-linked-buckets implementation, which can be horribly slow on modern processors due to the need to chase pointers. This means a lot of the potential performance improvements of allowing map elements to be unordered are lost.
Having said that I think using abseil's containers is reasonable, even as a default, if you can afford the dependency.
> std::unordered_map
AFAIK unordered_map is the most awful of all standard containers.