In the code below:
#include #include #include using namespace std; int main(){ pair p1(1,1);
This is supposed to happen. map.insert() will only insert elements into the container if it doesn't already contain any elements, so this will ignore the later value elements assigned to it.
map.insert()