3 ms·
ordered in a slightly weird way Do you mean "insertion ordered"? That means the order of iteration is guaranteed to match insertion order. C++'s std::map is
by throwaway2037 3y ago
ordered in a slightly weird way
Do you mean "insertion ordered"? That means the order of iteration is guaranteed to match insertion order. C++'s std::map is ordered by key (less than comparison) to create a binary search tree. So iteration order will always be ordered by key value. C++'s std::unordered_map has no ordering guarantees (that I know). I don't think the standard C++ template library has the equivalent of a modern Python dict, nor Java LinkedHashMap. Does anyone know if that is incorrect?