map重复插入,第二次插入的无效。
#include "item_base.h"
#include "test.h"
#include <string.h>
int main(void)
{
map<int,int>temp;
map<int,int>::iterator iter;
temp.insert(make_pair(1,2));
pair< map<int,int>::iterator , bool >pairtemp;
pairtemp=temp.insert(make_pair(1,3));
if(!pairtemp.second)
{
cout<<"this is map insert error!"<<endl;
}
iter=temp.begin();
cout<<iter->first<<"/t"<<iter->second<<endl;
return 0;
}