namespace __gnu_cxx
{
template<> struct hash<const string>
{
size_t operator()(const string& s) const
{ return hash<const char*>()( s.c_str() ); } //
__stl_hash_string
};
template<> struct hash<string>
{
size_t operator()(const string& s) const
{ return hash<const char*>()( s.c_str() ); }
};
}
int main( void )
{
hash_map<string,int> test;
test["abc"] = 1;
cout << test["abc"] << endl;
system( "pause" );
}
---