#include "absl/hash/hash.h"
#include <algorithm>
#include <array>
#include <bitset>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <initializer_list>
#include <ios>
#include <limits>
#include <memory>
#include <ostream>
#include <set>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <utility>
#include <vector>
#include "gtest/gtest.h"
#include "absl/base/config.h"
#include "absl/container/flat_hash_set.h"
#include "absl/hash/hash_testing.h"
#include "absl/hash/internal/hash_test.h"
#include "absl/hash/internal/spy_hash_state.h"
#include "absl/memory/memory.h"
#include "absl/meta/type_traits.h"
#include "absl/strings/cord_test_helpers.h"
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include "absl/types/variant.h"
#ifdef ABSL_INTERNAL_STD_FILESYSTEM_PATH_HASH_AVAILABLE
#include <filesystem>
#endif
#ifdef ABSL_HAVE_STD_STRING_VIEW
#include <string_view>
#endif
namespace …
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace hash_internal {
is_uniquely_represented<CustomHashType<Tags...>, typename EnableIfContained<InvokeTag::kUniquelyRepresented, Tags...>::type>;
}
ABSL_NAMESPACE_END
}
#if ABSL_HASH_INTERNAL_SUPPORT_LEGACY_HASH_
namespace ABSL_INTERNAL_LEGACY_HASH_NAMESPACE {
template <InvokeTag... Tags>
struct hash<CustomHashType<Tags...>> {
template <InvokeTag... TagsIn, typename = typename EnableIfContained<
InvokeTag::kLegacyHash, TagsIn...>::type>
size_t operator()(CustomHashType<TagsIn...> t) const {
static_assert(MinTag<Tags...>::value == InvokeTag::kLegacyHash, "");
return t.value + static_cast<int>(InvokeTag::kLegacyHash);
}
};
}
#endif
namespace std {
hash<CustomHashType<Tags...>>;
}
namespace …
namespace std {
template <>
struct hash<ValueWithBoolConversion> { … };
}
namespace {
TEST(HashTest, DoesNotUseImplicitConversionsToBool) { … }
TEST(HashOf, MatchesHashForSingleArgument) { … }
TEST(HashOf, MatchesHashOfTupleForMultipleArguments) { … }
template <typename T>
std::true_type HashOfExplicitParameter(decltype(absl::HashOf<T>(0))) { … }
template <typename T>
std::false_type HashOfExplicitParameter(size_t) { … }
TEST(HashOf, CantPassExplicitTemplateParameters) { … }
}