Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
735 B
C
Raw Normal View History

//===----------------------------------------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//
2010-05-11 19:42:16 +00:00
#ifndef TEST_HASH_H
#define TEST_HASH_H
#include <cstddef>
#include <utility>
2010-05-11 19:42:16 +00:00
template <class T>
class test_hash {
int data_;
2010-05-11 19:42:16 +00:00
public:
explicit test_hash(int data = 0) : data_(data) {}
2010-05-11 19:42:16 +00:00
std::size_t operator()(const T& x) const { return std::hash<T>()(x); }
2010-05-11 19:42:16 +00:00
bool operator==(const test_hash& c) const { return data_ == c.data_; }
2010-05-11 19:42:16 +00:00
};
#endif // TEST_HASH_H