Jump to content
  • Advertisement
Sign in to follow this  

Questions about stdext::hash_map

This topic is 3415 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have some questions about stdext::hash_map (the one provided with Visual C++). 1. The documentation asks me to provide a hash function (which returns a size_t) for the type T I'm going to store. Is this the actual hash function, i.e. should it provide a uniform distribution of the keys into the interval [0, 2^32] (assuming size_t is 32 bits long)? Or is it just a conversion of the type T to size_t, and the actual hash function (which distributes the size_t integers to the available hash table slots) is provided by stdext::hash_map itself? 2. How does stdext::hash_map resolve collisions? Does it use open addressing or chaining? Is there a way to force it into using one of those? 3. If I want to use perfect hashing, is there a way to do this with stdext::hash_map or must I write my own hashmap implementation or use some other library? I tried looking at the stdext::hash_map code, but my skills aren't enough to decipher it. Maybe someone can help? [Edited by - formalproof on May 20, 2009 7:04:51 AM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!