64,646
社区成员
发帖
与我相关
我的任务
分享
#include <hash_map>
namespace stdext
{
template<> size_t hash_compare< std::string, std::less< std::string > >::operator ()( const std::string& _stringBase ) const
{
register size_t ret = 0;
for( std::string::const_iterator it = _stringBase.begin(); it != _stringBase.end(); ++it )
ret = 5 * ret + *it;
return ret;
}
}
typedef stdext::hash_compare< string, std::less< string > > StringHash;
#include <hash_map>
namespace stdext
{
template<> size_t hash_compare< std::string, std::less< std::string > >::operator ()( const std::string& _stringBase ) const
{
register size_t ret = 0;
for( std::string::const_iterator it = _stringBase.begin(); it != _stringBase.end(); ++it )
ret = 5 * ret + *it;
return ret;
}
}
typedef stdext::hash_compare< std::string, std::less< std::string > > StringHash;