Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 #ifndef _BACKWARD_HASH_FUN_H
00058 #define _BACKWARD_HASH_FUN_H 1
00059
00060 #include <bits/c++config.h>
00061
00062 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
00063 {
00064 _GLIBCXX_BEGIN_NAMESPACE_VERSION
00065
00066 using std::size_t;
00067
00068 template<class _Key>
00069 struct hash { };
00070
00071 inline size_t
00072 __stl_hash_string(const char* __s)
00073 {
00074 unsigned long __h = 0;
00075 for ( ; *__s; ++__s)
00076 __h = 5 * __h + *__s;
00077 return size_t(__h);
00078 }
00079
00080 template<>
00081 struct hash<char*>
00082 {
00083 size_t
00084 operator()(const char* __s) const
00085 { return __stl_hash_string(__s); }
00086 };
00087
00088 template<>
00089 struct hash<const char*>
00090 {
00091 size_t
00092 operator()(const char* __s) const
00093 { return __stl_hash_string(__s); }
00094 };
00095
00096 template<>
00097 struct hash<char>
00098 {
00099 size_t
00100 operator()(char __x) const
00101 { return __x; }
00102 };
00103
00104 template<>
00105 struct hash<unsigned char>
00106 {
00107 size_t
00108 operator()(unsigned char __x) const
00109 { return __x; }
00110 };
00111
00112 template<>
00113 struct hash<signed char>
00114 {
00115 size_t
00116 operator()(unsigned char __x) const
00117 { return __x; }
00118 };
00119
00120 template<>
00121 struct hash<short>
00122 {
00123 size_t
00124 operator()(short __x) const
00125 { return __x; }
00126 };
00127
00128 template<>
00129 struct hash<unsigned short>
00130 {
00131 size_t
00132 operator()(unsigned short __x) const
00133 { return __x; }
00134 };
00135
00136 template<>
00137 struct hash<int>
00138 {
00139 size_t
00140 operator()(int __x) const
00141 { return __x; }
00142 };
00143
00144 template<>
00145 struct hash<unsigned int>
00146 {
00147 size_t
00148 operator()(unsigned int __x) const
00149 { return __x; }
00150 };
00151
00152 template<>
00153 struct hash<long>
00154 {
00155 size_t
00156 operator()(long __x) const
00157 { return __x; }
00158 };
00159
00160 template<>
00161 struct hash<unsigned long>
00162 {
00163 size_t
00164 operator()(unsigned long __x) const
00165 { return __x; }
00166 };
00167
00168 _GLIBCXX_END_NAMESPACE_VERSION
00169 }
00170
00171 #endif