For inserting a key-value pair into an unordered map, e.g., std::unordered_pair<int,int> map1, can we do it in any of these two ways:
map1[2]=5;
map1.insert({2,5});
Is there any difference between using std_unordered_insert or operator[]?
And if I want to find the mapped value for a given key, can I use either of the following:
mappedVal = map1.at(2);
mappedVal = map1[2];
Again, any difference between using std::unordered_map::at or operator[]?