help
Ian Haggard
ian@shellus.com
Thu Feb 19 07:34:00 GMT 1998
Here's the problem:
> hash_map<const char*, int> hm;
This needs to be something like:
hash_map< const char*, int,hash<const char*>,equal_to<string> > hm;
The problem you're encountering is that while I the hash function is presumably
finding the right string in the hash map, the equality comparison you're using
-- equals_to<const char*> -- is only comparing the ADDRESS of the
string-pointers, not the strings they point to.
--
Ian Haggard || ian@shellus.com (work) || IanHaggard@juno.com (home)
GNU/Linux -- "Oh, no, Mr Bill!" || #define employer_opinion !my_opinion
More information about the Gcc-bugs
mailing list