Reputation: 11580
At various places, I've read that STL does not provide hashtable and union data structures. How could these be implemented using other existing STL data structures?
Upvotes: 2
Views: 1383
Reputation: 22904
Try the std::tr1::unordered_map for your hash map. std::map is ordered, so it's not really as efficient as hash. Not sure what you mean by a union data structure, but you can have unioned structs in C++
EDIT: Additionally there are many other implementations of hash maps that some have done. Boost has an unordered map, Prasoon mentioned one in the question comments, and Google has sparsehash.
Upvotes: 8