ultimatepp/uppdev/www/ntls.h
cxl 4a1c627474 Adding uppdev....
git-svn-id: svn://ultimatepp.org/upp/trunk@328 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2008-08-15 08:36:24 +00:00

30 lines
456 B
C++

#ifndef NTLS_H
#define NTLS_H
#include <string>
#include <ntl.h>
NTL_MOVEABLE(std::string)
template<>
inline unsigned GetHashValue(const std::string& x)
{
return memhash(x.c_str(), x.size());
}
#ifndef NOWSTRING
NTL_MOVEABLE(std::wstring)
template<>
inline unsigned GetHashValue(const std::wstring& x)
{
CombineHash hash;
for(size_t i = 0; i != x.size(); ++i)
hash = hash.Put(x[i]);
return hash;
}
#endif
#endif