3 ms·
Hash maps are extremely difficult to make general which is probably why they were never included in C++98. unordered_map is a disaster.
by citizen_friend 2y ago
Hash maps are extremely difficult to make general which is probably why they were never included in C++98. unordered_map is a disaster.
- tialaramex 2y agoIt's extremely hard, so with 13 extra years they were able to make an astoundingly bad job? It's hard to even believe this was trying to be general. Notice that not only the hash tables themselves, but the infrastructure is garbage too. In 1998 C++ STL is one of the earliest generic programming APIs, nobody knows how you should implement the generality of something like hashing, fine. But by 2011 people had tried several things, and this (the std::hash templated callable which returns a machine-word integer) is not even a reasonable attempt at a known good design.