std::hash_map<int, std::string> hashmap;
hashmap.insert(std::hash_map<int, std::string>::value_type( 7, "string"));
printf("%d %s \n", hashmap.find(7)->first, hashmap.find(7)->second.c_str());
printf("unordered_map\n");
std::unordered_map<int, std::string> unordermap;
unordermap.insert(std::unordered_map<int, std::string>::value_type( 5, "unodrer" ));
unordermap.insert(std::unordered_map<int, std::string>::value_type( 10, "map" ));
std::unordered_map<int, std::string>::iterator uniter = unordermap.begin();
while( unordermap.end() != uniter )
{
printf(" %d %s \n", uniter->first, uniter->second.c_str() );
uniter++;
}
printf("\n");
printf("%d %s \n", unordermap.find(5)->first, unordermap.find(5)->second.c_str());
'c++' 카테고리의 다른 글
std::thread (2) (0) | 2015.01.06 |
---|---|
std::thread (0) | 2015.01.06 |
std::chrono (0) | 2015.01.06 |
std::list, std::foward_list (0) | 2015.01.06 |
std::pair, std::tuple (0) | 2015.01.06 |