unordered map Question 7

Last Updated :
Discuss
Comments

How do at() and operator[] differ for missing keys?

at() throws exception; operator[] inserts

Both insert a default value

operator[] throws; at() inserts

Both throw exceptions

Share your thoughts in the comments