ReactOS 0.4.16-dev-340-g0540c21
_string_hash.h File Reference
#include <stl/_hash_fun.h>
#include <stl/_string.h>
Include dependency graph for _string_hash.h:

Go to the source code of this file.

Classes

struct  hash< string >
 

Functions

template<class _CharT , class _Traits , class _Alloc >
_STLP_BEGIN_NAMESPACE _STLP_INLINE_LOOP size_t __stl_string_hash (const basic_string< _CharT, _Traits, _Alloc > &__s)
 

Function Documentation

◆ __stl_string_hash()

template<class _CharT , class _Traits , class _Alloc >
_STLP_BEGIN_NAMESPACE _STLP_INLINE_LOOP size_t __stl_string_hash ( const basic_string< _CharT, _Traits, _Alloc > &  __s)

Definition at line 34 of file _string_hash.h.

34 {
35 unsigned long __h = 0;
36 size_t __len = __s.size();
37 const _CharT* __data = __s.data();
38 for ( size_t __i = 0; __i < __len; ++__i)
39 __h = /* 5 *__h */(__h << 2) + __h + __data[__i];
40 return size_t(__h);
41}
size_type size() const
Definition: _string.h:400
const _CharT * data() const
Definition: _string.h:950
__kernel_size_t size_t
Definition: linux.h:237

Referenced by hash< string >::operator()().