32 _GLIBCXX_BEGIN_NAMESPACE_TR1
37 template<
typename _Tp>
41 operator()(_Tp __val)
const;
45 template<
typename _Tp>
49 operator()(_Tp* __p)
const
50 {
return reinterpret_cast<size_t>(__p); }
54 #define _TR1_hashtable_define_trivial_hash(_Tp) \
57 hash<_Tp>::operator()(_Tp __val) const \
58 { return static_cast<size_t>(__val); }
65 #ifdef _GLIBCXX_INCLUDE_AS_CXX0X
78 #undef _TR1_hashtable_define_trivial_hash
84 template<
size_t = sizeof(
size_t)>
88 hash(
const char* __first,
size_t __length)
91 for (; __length > 0; --__length)
92 __result = (__result * 131) + *__first++;
101 hash(
const char* __first,
size_t __length)
103 size_t __result =
static_cast<size_t>(2166136261UL);
104 for (; __length > 0; --__length)
106 __result ^=
static_cast<size_t>(*__first++);
107 __result *=
static_cast<size_t>(16777619UL);
117 hash(
const char* __first,
size_t __length)
120 static_cast<size_t>(14695981039346656037ULL);
121 for (; __length > 0; --__length)
123 __result ^=
static_cast<size_t>(*__first++);
124 __result *=
static_cast<size_t>(1099511628211ULL);
133 hash<float>::operator()(
float __val)
const
139 __result = _Fnv_hash<>::hash(reinterpret_cast<const char*>(&__val),
147 hash<double>::operator()(
double __val)
const
153 __result = _Fnv_hash<>::hash(reinterpret_cast<const char*>(&__val),
161 hash<long double>::operator()(
long double __val)
const;
166 hash<string>::operator()(
string)
const;
170 hash<const string&>::operator()(
const string&)
const;
172 #ifdef _GLIBCXX_USE_WCHAR_T
175 hash<wstring>::operator()(wstring)
const;
179 hash<const wstring&>::operator()(
const wstring&)
const;
182 _GLIBCXX_END_NAMESPACE_TR1
Dummy generic implementation (for sizeof(size_t) != 4, 8).
#define _TR1_hashtable_define_trivial_hash(_Tp)
Explicit specializations for integer types.