3 #ifndef CDSTEST_HDR_INTRUSIVE_CUCKOO_SET_COMMON_H
4 #define CDSTEST_HDR_INTRUSIVE_CUCKOO_SET_COMMON_H
9 typedef IntrusiveCuckooSetHdrTest::hash_int hash1;
10 struct hash2: private hash1
12 typedef hash1 base_class;
14 size_t operator()( int i ) const
16 size_t h = ~( base_class::operator()(i));
17 return ~h + 0x9e3779b9 + (h << 6) + (h >> 2);
19 template <typename Item>
20 size_t operator()( const Item& i ) const
22 size_t h = ~( base_class::operator()(i));
23 return ~h + 0x9e3779b9 + (h << 6) + (h >> 2);
25 size_t operator()( IntrusiveCuckooSetHdrTest::find_key const& i) const
27 size_t h = ~( base_class::operator()(i));
28 return ~h + 0x9e3779b9 + (h << 6) + (h >> 2);
35 bool operator ()(const T& v1, const T& v2 ) const
37 return v1.key() == v2.key();
41 bool operator ()(const T& v1, const Q& v2 ) const
43 return v1.key() == v2;
47 bool operator ()(const Q& v1, const T& v2 ) const
49 return v1 == v2.key();
56 #endif // #ifndef CDSTEST_HDR_INTRUSIVE_CUCKOO_SET_COMMON_H