Click to See Complete Forum and Search --> : hash_set and std::string


imi123_1999
March 22nd, 2003, 12:42 AM
Friends, i am doing something like:

using namespace std;

hash_set<string> myhashstring;

myhashstring.insert("USA");


As such program is giving me error that:

(38): error C2440: 'type cast' : cannot convert from 'const std::string' to 'size_t'


But if i use "set" instead of "hash_set" the program works normally. Any one guess whats the problem ???

Graham
March 22nd, 2003, 04:16 AM
hash_set is not part of ISO standard C++. It's entirely possible that there's a bug in whatever standard library implementation you're using. We'll need a few more details to pin it down, though.

imi123_1999
March 22nd, 2003, 06:34 AM
I am using the hash_set implementation that comes with VC++ 7.0 compiler.

Graham
March 22nd, 2003, 06:38 AM
Sorry, can't help, since I've not used VC++ 7.0