I’m looking for a HashTable or Dictionary implementation in C++ that has similar functionality to the one in C#? Does the STL contain an object like this and how would I use it?
I’m looking for a HashTable or Dictionary implementation in C++ that has similar functionality
Share
Actually, to be exactly the same as .NET’s Dictionary/Hashtable, what you want is hash_map or unordered_map (
std::mapis implemented as a binary tree),hash_mapis an extension to the SC++L. Most compilers that I know of come withhash_map, though, and boost obviously hasunordered_mapuntil C++0x is available in all compilers, so you should just be able to use it without trouble.