37 ms·
For debug purposes you throw away security and define a fixed seed, which implies the ordering. Equivalence checks on unordered containers are different, and a
by rurban 5y ago
For debug purposes you throw away security and define a fixed seed, which implies the ordering.
Equivalence checks on unordered containers are different, and any framework which cannot check equivalence of unordered containers are worthless. Forcing ordering on inherently unordered containers does have it's price, it's certainly not free. You can pay that price at serialization, or for testing, but it makes not much sense elsewhere.
Unordered maps don't hate you, you are just not equipped to deal with it. Insertion ordered maps were a thing in the 80s with lisp property lists, which did hold your environment of symbols properly. But since then everyone switched over to proper hashmaps already. Just some not yet: Emacs, python, PHP, ...
You cannot get rid of old sins easily
- __s 5y agoCPython has insertion ordered maps as of 3.6 after a memory usage optimization, & didn't before. 3.7 made it spec