TPIE

v1.1rc1-6-g0c97303
tpie::hash< const char * > Struct Template Reference

Default hashing function for C-style strings. More...

#include <tpie/hash_map.h>

Public Member Functions

size_t operator() (const char *s) const
 Calculate string hash. More...
 

Detailed Description

template<>
struct tpie::hash< const char * >

Default hashing function for C-style strings.

Definition at line 70 of file hash_map.h.

Member Function Documentation

size_t tpie::hash< const char * >::operator() ( const char *  s) const
inline

Calculate string hash.

Parameters
sString to hash.

Definition at line 75 of file hash_map.h.

75  {
76  uint32_t r = 1;
77  for(int i=0; s[i]; i++){
78  r = r*13+s[i]*7;
79  }
80  return r;
81  }

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