3 #include "simplified_cliffc_hashtable.h"
7 template<typename TypeK, typename TypeV>
8 slot* const cliffc_hashtable<TypeK, TypeV>::MATCH_ANY = new slot(false, NULL);
10 template<typename TypeK, typename TypeV>
11 slot* const cliffc_hashtable<TypeK, TypeV>::NO_MATCH_OLD = new slot(false, NULL);
13 template<typename TypeK, typename TypeV>
14 slot* const cliffc_hashtable<TypeK, TypeV>::TOMBPRIME = new slot(true, NULL);
16 template<typename TypeK, typename TypeV>
17 slot* const cliffc_hashtable<TypeK, TypeV>::TOMBSTONE = new slot(false, NULL);
25 IntWrapper(int val) : _val(val) {}
27 IntWrapper() : _val(0) {}
29 IntWrapper(IntWrapper& copy) : _val(copy._val) {}
39 bool equals(const shared_ptr<void> another) {
42 shared_ptr<IntWrapper> ptr =
43 static_pointer_cast<IntWrapper>(another);
44 return ptr->_val == _val;
48 int main(int argc, char *argv[]) {
49 cliffc_hashtable<IntWrapper, IntWrapper> table;
50 IntWrapper k1(3), k2(4), v1(1), v2(2);
55 cout << table.get(k2)->get() << endl;