hash_map testMap; 为什么会出错。
class test
{
public:
test();
virtual ~test();
};
void main( void )
{
typedef std::hash_map<string, test> testHash;
typedef hash_map<string, test>::iterator iterHash;
typedef pair<string, test> testPair;
testPair tp;
test t;
testHash th;
iterHash iter;
tp.first = string("test1");
tp.second = t;
th.insert(tp);
iter = th.begin();
printf(iter->first.c_str());
printf("\n");
}
D:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xhash(38): error C2440: “类型转换” : 无法从“const std::string”转换为“size_t”
???为什么,谢谢大家