blob: ba562868b3729b9359c54ef09b45e03b9229c80d [file] [log] [blame]
Howard Hinnant3e519522010-05-11 19:42:16 +00001#ifndef TEST_COMPARE_H
2#define TEST_COMPARE_H
3
4#include <cstddef>
5#include <type_traits>
6#include <cstdlib>
7#include <new>
8#include <climits>
9
10template <class C>
11class test_compare
12 : private C
13{
14 int data_;
15public:
16 explicit test_compare(int data = 0) : data_(data) {}
17
18 typename C::result_type
19 operator()(typename std::add_lvalue_reference<const typename C::first_argument_type>::type x,
20 typename std::add_lvalue_reference<const typename C::second_argument_type>::type y) const
21 {return C::operator()(x, y);}
22
23 bool operator==(const test_compare& c) const
24 {return data_ == c.data_;}
25};
26
Howard Hinnant8f2f7e72010-08-22 00:15:28 +000027#endif // TEST_COMPARE_H