4 ms·
For once, C++ got some usability right and created std::map and std::unordered_map which have explicit key ordering behaviour. Now, back to waiting for my proj
by danpat 10y ago
For once, C++ got some usability right and created std::map and std::unordered_map which have explicit key ordering behaviour.
Now, back to waiting for my project to compile.....
- Sharlin 10y agoJava as well. Need sorted? TreeMap. High-performance but unordered? HashMap. Preserve insertion order? LinkedHashMap.
- tdb7893 10y agoI would guess it probably is the same way in c++ but I've never spent more than 5 seconds considering which collection to use in Java. They have a decent amount of them but once you are aware of their existence they are incredibly intuitive
- petertodd 10y agoFWIW Python has had OrderedDict for years.
- pekk 10y agoIf you think offering every variation of data structures is doing usability right, then C++ has done a lot of usability right. So much that its usability has suffered.