Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

To be fair, C++ has std::map and iostream/printf, so two of the examples given here as "in Rust's standard library and not in C++'s" are wrong.

Now there are reasons many people choose not to use the built in C++ std::map, and very nearly this ended up the case for Rust's HashMap, until they switched the implementation to the crate that was becoming popular. But even there's design decisions, like Rust using more compute to have a strong hash to avoid DoS attacks, that some may feel are inappropriate for their use cases.



You probably mean std::unordered_map, not std::map. std::map is a red-black tree, so it's akin to TreeMap in Java or BTreeMap in Rust. (It really is a shame that the smallest name for an associative array in C++ is for the version that is the least useful).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: