I usually use C++ stdlib map whenever I need to store some data associated with a specific type of value (a key value - e.g. a string or other object). The stdlib map implem
There is a hash_map object as many here have mentioned, but it is not part of the stl. It is a SGI extension, so if you were looking for something in the STL, I think you are out of luck.
hash_map is also supported in GNU's libstdc++.
Dinkumware also supports this, which means that lots of implementations will have a hash_map (I think even Visual C++ delivers with Dinkumware).
Visual Studio has the class stdext::hash_map
in the header <hash_map>
, and gcc has the class __gnu_cxx::hash_map
in the same header.