Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I use the stl hashtable.h

Status
Not open for further replies.

tryfekid

Programmer
Aug 16, 2001
9
US
i'm compiling in g++ and there is an avaialble hashtable.h that references stl_hashtable.h. it is a parameterized hashtable but i'm having trouble understanding the template parameters. if ya'll can help me out, i'd appreciate it.

template <class _Val, class _Key, class _HashFcn,
class _ExtractKey, class _EqualKey, class _Alloc = alloc> class hashtable;


i don't understand the _HashFcn, _ExtractKey, and _EqualKey parameters. Can someone please explain what i need to do to instantiate a hashtable object.

Thanks.
 
*********************************************************************************
Parameter Description Default
Key The hash_map's key type. This is also defined as hash_map::key_type.
Data The hash_map's data type. This is also defined as hash_map::data_type.
HashFcn The hash function used by the hash_map. This is also defined as hash_map::hasher. hash<Key>
EqualKey The hash_map key equality function: a binary predicate that determines whether two keys are equal. This is also defined as hash_map::key_equal. equal_to<Key>
Alloc The hash_map's allocator, used for all internal memory management. alloc


Check out:

This deals with hash maps, but if you go up one level there is also documentation for a hash list. Not exactly a hash table but I think it's along the same lines. Tables and lists are very similar. Hope this helps. MYenigmaSELF:-9
myenigmaself@yahoo.com
&quot;If debugging is the process of removing bugs, then programming must be the process of putting them in.&quot; --Dykstra
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top