Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stdext::hash< std::string > Class Template Reference

#include <gnuhash.h>

Public Member Functions

size_t operator() (const std::string &key) const
 

Detailed Description

template<>
class stdext::hash< std::string >

Definition at line 70 of file gnuhash.h.

Member Function Documentation

size_t stdext::hash< std::string >::operator() ( const std::string &  key) const
inline

Definition at line 73 of file gnuhash.h.

References k, and start.

74  {
75  size_t _HASH_INTSIZE = (sizeof (size_t)*8);
76  size_t _HASH_SALT_0 = 0x7EF92C3B;
77  size_t _HASH_SALT_1 = 0x9B;
78  size_t k = 0;
79  for (std::string::const_iterator start = key.begin(); start != key.end(); start++) {
80  k ^= (*start&_HASH_SALT_1);
81  k ^= _HASH_SALT_0;
82  k = ( ( (k>>4)&0xF )|( k<<(_HASH_INTSIZE-4) ) );
83  k ^= *start;
84  }
85  return k;
86  }

The documentation for this class was generated from the following file: