Using std::map Wisely With Modern C++

std::map and its siblings(std::multimap, std::unordered_map/multimap) used to be my favourite containers when I was doing competitive programming. In fact, I still like them(though using less frequently nowadays). And with Modern C++, we now have more reasons to use std::map. That’s why I have decided to address this topic by writing an article summarizing these new features. So, without much gibberish, let’s dive-in directly. std::map::contains(C++20) std::map::contains member function is a good step towards code expressiveness....

July 8, 2020 · 10 min · 2120 words · Vishal Chovatiya