blob: 1a70e7cbdd9a9f3e240ff981856a62a229e8b2a8 [file] [log] [blame]
Marshall Clow98760c12014-01-16 16:58:45 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000010#ifndef TEST_HASH_H
11#define TEST_HASH_H
12
13#include <cstddef>
14#include <type_traits>
15
16template <class C>
17class test_hash
18 : private C
19{
20 int data_;
21public:
22 explicit test_hash(int data = 0) : data_(data) {}
23
24 std::size_t
25 operator()(typename std::add_lvalue_reference<const typename C::argument_type>::type x) const
26 {return C::operator()(x);}
27
28 bool operator==(const test_hash& c) const
29 {return data_ == c.data_;}
30};
31
Howard Hinnant6046ace2010-08-22 00:15:28 +000032#endif // TEST_HASH_H