Use an unordered_map.

Which implies C++11.