News for hackers. Stuff that matters.
Re:C++17 Is Here: Interview with Herb Sutter by kllrnohj on Tuesday October 24, 2017 @03:40PM (#15544575)
> Superior in what way?

Superior in performance, and you can pick if you want to optimize for iteration (put the keys in a sorted vector) or insertion (linked list). Either way you'll trivially beat traversing, inserting, and removing elements from a red-black tree in runtime.

> Basically, I'd traverse a map and delete some elements during traversal.

That works fine with unordered_map, too. You can keep the iterator when you remove. It's only inserts where map's iterators stays valid but unordered_map's doesn't.

There are no comments on this comment yet.