unordered_map,可以看做是一个哈希映射,当你需要记录大量K/V键值对时适用。
声明:
unordered_map<Key_Type, Value_Type> name;
使用时类似于map:name["you"] = "Alan";
cout<<name["you"]<<endl; // Alan
遍历
for (unordered_map<string,string>::iterator it = name.begin(); it != name.end; ++it) {
cout<<it->first<<" "<<it->second<<endl;
}