2014-01-16 16:58:45 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2019-01-19 10:56:40 +00:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2014-01-16 16:58:45 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2010-05-11 19:42:16 +00:00
|
|
|
#ifndef TEST_COMPARE_H
|
|
|
|
#define TEST_COMPARE_H
|
|
|
|
|
2021-05-29 10:13:14 -04:00
|
|
|
template <class T>
|
|
|
|
struct test_equal_to
|
2010-05-11 19:42:16 +00:00
|
|
|
{
|
|
|
|
int data_;
|
2021-05-29 10:13:14 -04:00
|
|
|
explicit test_equal_to() : data_(0) {}
|
|
|
|
explicit test_equal_to(int data) : data_(data) {}
|
|
|
|
bool operator()(const T& a, const T& b) const
|
|
|
|
{ return a == b; }
|
|
|
|
friend bool operator==(const test_equal_to& a, const test_equal_to& b)
|
|
|
|
{ return a.data_ == b.data_; }
|
2010-05-11 19:42:16 +00:00
|
|
|
};
|
|
|
|
|
2021-05-29 10:13:14 -04:00
|
|
|
template <class T>
|
|
|
|
struct test_less
|
2017-11-22 06:02:27 +00:00
|
|
|
{
|
2021-05-29 10:13:14 -04:00
|
|
|
int data_;
|
|
|
|
explicit test_less() : data_(0) {}
|
|
|
|
explicit test_less(int data) : data_(data) {}
|
|
|
|
bool operator()(const T& a, const T& b) const
|
|
|
|
{ return a < b; }
|
|
|
|
friend bool operator==(const test_less& a, const test_less& b)
|
|
|
|
{ return a.data_ == b.data_; }
|
2017-11-22 06:02:27 +00:00
|
|
|
};
|
|
|
|
|
2021-04-20 12:03:32 -04:00
|
|
|
#endif // TEST_COMPARE_H
|