the <hash_map> header file from STL is letting in multiple keys

I am trying to build a hash table to get rid of duplicate data that I have, but the number of entries in my hash table keeps on changing. Upon doing some debugging work, I found that hash compare does not get called when the extra key is allowed to slip in. I am using insert and find from the library header and both of the call on the iterator struct. Does anyone know how exactly the call stack works and why it misses doing the comparison sometimes?
<hash_map> is not part of the STL. It's a non-standard extension. You don't mention what compiler of standard C++ library you are using.

TR1 introduced <unordered_map> to the C++ standard library which likely does what you want. You might want to try that.

That said, it's quite possible you are using invalid iterators in some of your operations and either being confused by the results or corrupting your map.
http://msdn.microsoft.com/en-us/library/617f83za(v=VS.80).aspx

The documentation I got for my <hash_map> is from the website above. It is part of stdext. I would really like to find what might be causing these errors and be able to fix my existing code because it seems less time efficient to learn how to implement the tri <unordered_map> and then debug it. I have my function calls in a loop. There are a bunch of objects which each call hash to add it to the hash table. There is nothing special about the duplicate entries that are being added. In my test, I am adding a whole series of duplicate keys. Most of them are screened, but a few here and there are let in. It is not the same each time I run the program.
Topic archived. No new replies allowed.