map是STL提供的关联容器,提供一对一的hash,以(key,value)的形式存在,可以储存任意类型的数据。map中的元素自动按key的升序排序。
头文件:#include
do{
cout<first<<”=>”<second< }while(mycomp((*it++).first,high)){key值为high时,循环终止}
10.返回比较元素value的函数:
it=temp1.begin();
pair last=*temp1.rbegin();
do{
cout<first<<”=>”<second< }while(temp1.value_comp()(*it++,last));{value值为last时,循环终止}