#include #include #include // for size_t #include // for allocator, string, operator== #include // for pair, move #include // for vector namespace { struct foo { uint64_t m_i; }; } // namespace template <> struct std::hash { auto operator()(foo const& foo) const noexcept { return static_cast(foo.m_i + 1); } }; TEST_CASE("std_hash") { auto f = foo{12345}; REQUIRE(std::hash{}(f) == 12346U); // unordered_dense::hash blows that up to 64bit! // Just wraps std::hash REQUIRE(ankerl::unordered_dense::hash{}(f) == UINT64_C(12346)); REQUIRE(ankerl::unordered_dense::hash{}(12346U) == UINT64_C(0x3F645BE4CE24110C)); }