(VC++编译器) map 的四种插入数据的方法中,为什么make_pair不好用?
#include <iostream>
#include <map>
#include <string>
using namespace std;
int main()
{
typedef map<string,float> StringFloatMap;
StringFloatMap coll;
coll["a"] = 1;
coll.insert(map<string,float>::value_type("b",2));
coll.insert(pair<string,float>("c",3));
// coll.insert(make_pair("d",4));
map<string, float>::iterator pos;
for (pos = coll.begin();pos != coll.end();++pos)
{
cout << pos->second << endl;
}
return 0;
}