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_HASH_H
|
|
|
|
#define TEST_HASH_H
|
|
|
|
|
|
|
|
#include <cstddef>
|
2021-06-11 21:05:17 -04:00
|
|
|
#include <utility>
|
2010-05-11 19:42:16 +00:00
|
|
|
|
2021-06-11 21:05:17 -04:00
|
|
|
template <class T>
|
2025-02-11 06:17:39 +01:00
|
|
|
class test_hash {
|
|
|
|
int data_;
|
|
|
|
|
2010-05-11 19:42:16 +00:00
|
|
|
public:
|
2025-02-11 06:17:39 +01:00
|
|
|
explicit test_hash(int data = 0) : data_(data) {}
|
2010-05-11 19:42:16 +00:00
|
|
|
|
2025-02-11 06:17:39 +01:00
|
|
|
std::size_t operator()(const T& x) const { return std::hash<T>()(x); }
|
2010-05-11 19:42:16 +00:00
|
|
|
|
2025-02-11 06:17:39 +01:00
|
|
|
bool operator==(const test_hash& c) const { return data_ == c.data_; }
|
2010-05-11 19:42:16 +00:00
|
|
|
};
|
|
|
|
|
2021-04-20 12:03:32 -04:00
|
|
|
#endif // TEST_HASH_H
|