Index: Source/wtf/HashFunctions.h |
diff --git a/Source/wtf/HashFunctions.h b/Source/wtf/HashFunctions.h |
index a9eb156fbc6f67b2475297cfacd99fff6e10031c..f58f8e6699ff21132044cc489834e399cf035007 100644 |
--- a/Source/wtf/HashFunctions.h |
+++ b/Source/wtf/HashFunctions.h |
@@ -143,6 +143,14 @@ namespace WTF { |
static bool equal(P* a, const RefPtr<P>& b) { return a == b; } |
static bool equal(const RefPtr<P>& a, P* b) { return a == b; } |
}; |
+ template<typename P> struct PtrHash<RawPtr<P> > : PtrHash<P*> { |
+ using PtrHash<P*>::hash; |
+ static unsigned hash(const RawPtr<P>& key) { return hash(key.get()); } |
+ using PtrHash<P*>::equal; |
+ static bool equal(const RawPtr<P>& a, const RawPtr<P>& b) { return a == b; } |
+ static bool equal(P* a, const RawPtr<P>& b) { return a == b; } |
+ static bool equal(const RawPtr<P>& a, P* b) { return a == b; } |
+ }; |
// default hash function for each type |
@@ -189,6 +197,7 @@ namespace WTF { |
template<typename P> struct DefaultHash<P*> { typedef PtrHash<P*> Hash; }; |
template<typename P> struct DefaultHash<RefPtr<P> > { typedef PtrHash<RefPtr<P> > Hash; }; |
+ template<typename P> struct DefaultHash<RawPtr<P> > { typedef PtrHash<RawPtr<P> > Hash; }; |
// make IntPairHash the default hash function for pairs of (at most) 32-bit integers. |