What is the difference in getting a value through aMap[key] and aMap.at(key) in C++?
aMap[key]
aMap.at(key)
In C++11 map::at exists (who knew?).
map::at
It throws an exception if the key doesn't exist, find returns aMap.end() if the element doesn't exist, and operator[] value-initializes a new value for the corresponding key if no value exists there.
find
aMap.end()
operator[]