|
@@ -80,6 +80,15 @@ class HashMap final {
|
|
|
other.clear();
|
|
|
}
|
|
|
|
|
|
+ template<typename H>
|
|
|
+ static int hash(const H& key) {
|
|
|
+ return key.hashCode();
|
|
|
+ }
|
|
|
+
|
|
|
+ static int hash(int key) {
|
|
|
+ return key;
|
|
|
+ }
|
|
|
+
|
|
|
public:
|
|
|
|
|
|
HashMap() : used(false) {
|
|
@@ -191,17 +200,6 @@ public:
|
|
|
}
|
|
|
s.append("]");
|
|
|
}
|
|
|
-
|
|
|
-private:
|
|
|
-
|
|
|
- template<typename H>
|
|
|
- static int hash(const H& key) {
|
|
|
- return key.hashCode();
|
|
|
- }
|
|
|
-
|
|
|
- static int hash(int key) {
|
|
|
- return key;
|
|
|
- }
|
|
|
};
|
|
|
|
|
|
#endif
|