struct Entry {
int key;
- float value;
-
- static const int& Key(const Entry& entry) { return entry.key; }
- static uint32_t Hash(const int& key) { return key; }
- static bool Equal(const Entry& entry, const int& key) { return entry.key == key; }
+ double value;
};
+const int& GetKey(const Entry& entry) { return entry.key; }
+uint32_t GetHash(const int& key) { return key; }
+bool AreEqual(const Entry& entry, const int& key) { return entry.key == key; }
+
-class Hash : public SkTDynamicHash<Entry, int, Entry::Key, Entry::Hash, Entry::Equal> {
+class Hash : public SkTDynamicHash<Entry, int, GetKey, GetHash, AreEqual> {
public:
Hash() : INHERITED() {}
Hash(int capacity) : INHERITED(capacity) {}
int countCollisions(const int& key) const { return this->INHERITED::countCollisions(key); }
private:
- typedef SkTDynamicHash<Entry, int, Entry::Key, Entry::Hash, Entry::Equal> INHERITED;
+ typedef SkTDynamicHash<Entry, int, GetKey, GetHash, AreEqual> INHERITED;
};
} // namespace