std::unordered_map<int, int> unordered;
std::map<int, int> ordered(unordered.begin(), unordered.end());
for(auto it = ordered.begin(); it != ordered.end(); ++it)
std::cout << it->second;
http://stackoverflow.com/questions/6212619/sorting-tr1-unordered-map-by-key
'Programming' 카테고리의 다른 글
Makefile tutorial (0) | 2013.02.26 |
---|---|
How to use EOF to run through a text file in C? (0) | 2013.02.26 |
(Java) [번역]자바 Enum의 10가지 예제 (0) | 2013.02.24 |
Java for C Users (3): isDigit (0) | 2013.02.24 |
(Java) how can I get the type of the object ? (0) | 2013.02.24 |