27 if constexpr (
requires { std::hash<T>{}(value); }) {
28 return std::hash<T>{}(value);
30 return static_cast<std::size_t
>(value);
50template <
class... Values_T>
52 static_assert(
sizeof(std::size_t) == 8,
53 "hashCombine() only supports a 64-bit std::size_t, as the mixing constants are chosen for that width.");
55 constexpr auto mix = [](std::size_t x) {
56 constexpr std::uint64_t m = 0xe9846af9b1a615dULL;
66 ((seed = mix(seed + 0x9e3779b9 +
hashValue(values))), ...);
In this namespace some helper classes and functions can be found used inside of AutoPas.
Definition: namespaces.h:44
std::size_t hashValue(const T &value)
Hash of a single value.
Definition: HashCombine.h:26
std::size_t hashCombine(const Values_T &...values)
Combines the hashes of an arbitrary number of values into one hash.
Definition: HashCombine.h:51