In STL maps, is it better to use map::insert than []?
A while ago, I had a discussion with a colleague about how to insert values in STL maps. I preferred map[key] = value; because it feels natural and is clear to read whereas he preferred map.insert(std::make_pair(key, value)). I just asked him and neither of us can remember the reason why insert is better, but I … Read more