From 35cf1d65b454985c38b1e00a91670663b1583670 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 2 Oct 2022 03:23:05 +0200 Subject: a --- attic/hash.hpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 attic/hash.hpp (limited to 'attic') diff --git a/attic/hash.hpp b/attic/hash.hpp new file mode 100644 index 00000000..75eea7a9 --- /dev/null +++ b/attic/hash.hpp @@ -0,0 +1,25 @@ +#pragma once +#include +#include + +namespace Magnum::Examples { + +template struct hash; + +template<> +struct hash<32> final { + [[maybe_unused]] + constexpr std::uint32_t operator()(std::uint32_t x) const noexcept { + return (std::uint32_t)x*0x9e3779b1u; + } +}; + +template<> +struct hash<64> final { + [[maybe_unused]] + constexpr std::uint64_t operator()(std::uint64_t x) const noexcept { + return x*0x9e3779b97f4a7c15ull; + } +}; + +} // namespace Magnum::Examples -- cgit v1.2.3