Home | History | Annotate | Download | only in wtf

Lines Matching defs:Hash

35     // integer hash function
90 static unsigned hash(T key) { return intHash(static_cast<typename IntTypes<sizeof(T)>::UnsignedType>(key)); }
96 static unsigned hash(T key)
109 // pointer identity hash function
112 static unsigned hash(T key)
118 return IntHash<uintptr_t>::hash(reinterpret_cast<uintptr_t>(key));
127 using PtrHash<P*>::hash;
128 static unsigned hash(const RefPtr<P>& key) { return hash(key.get()); }
135 // default hash function for each type
140 static unsigned hash(const std::pair<T, U>& p)
142 return intHash((static_cast<uint64_t>(DefaultHash<T>::Hash::hash(p.first)) << 32 | DefaultHash<U>::Hash::hash(p.second)));
146 return DefaultHash<T>::Hash::equal(a.first, b.first) && DefaultHash<U>::Hash::equal(a.second, b.second);
148 static const bool safeToCompareToEmptyOrDeleted = DefaultHash<T>::Hash::safeToCompareToEmptyOrDeleted
149 && DefaultHash<U>::Hash::safeToCompareToEmptyOrDeleted;
152 // make IntHash the default hash function for many integer types
154 template<> struct DefaultHash<short> { typedef IntHash<unsigned> Hash; };
155 template<> struct DefaultHash<unsigned short> { typedef IntHash<unsigned> Hash; };
156 template<> struct DefaultHash<int> { typedef IntHash<unsigned> Hash; };
157 template<> struct DefaultHash<unsigned> { typedef IntHash<unsigned> Hash; };
158 template<> struct DefaultHash<long> { typedef IntHash<unsigned long> Hash; };
159 template<> struct DefaultHash<unsigned long> { typedef IntHash<unsigned long> Hash; };
160 template<> struct DefaultHash<long long> { typedef IntHash<unsigned long long> Hash; };
161 template<> struct DefaultHash<unsigned long long> { typedef IntHash<unsigned long long> Hash; };
164 template<> struct DefaultHash<wchar_t> { typedef IntHash<wchar_t> Hash; };
167 template<> struct DefaultHash<float> { typedef FloatHash<float> Hash; };
168 template<> struct DefaultHash<double> { typedef FloatHash<double> Hash; };
170 // make PtrHash the default hash function for pointer types that don't specialize
172 template<typename P> struct DefaultHash<P*> { typedef PtrHash<P*> Hash; };
173 template<typename P> struct DefaultHash<RefPtr<P> > { typedef PtrHash<RefPtr<P> > Hash; };
175 template<typename T, typename U> struct DefaultHash<std::pair<T, U> > { typedef PairHash<T, U> Hash; };