36#ifndef LIBUTILITIES_BASICUTILS_HASHUTILS
37#define LIBUTILITIES_BASICUTILS_HASHUTILS
48template <
typename T,
typename... Args>
49inline void hash_combine(std::size_t &seed,
const T &v, Args... args)
52 seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
56template <
typename T,
typename... Args>
57inline std::size_t
hash_combine([[maybe_unused]]
const T &v, Args... args)
64template <
typename Iter> std::size_t
hash_range(Iter first, Iter last)
67 for (; first != last; ++first)
74template <
typename Iter>
84 return static_cast<std::size_t
>(t);
90 template <
class T1,
class T2>
94 auto h1 = std::hash<T1>{}(
p.first);
95 auto h2 = std::hash<T2>{}(
p.second);
std::size_t hash_range(Iter first, Iter last)
void hash_combine(std::size_t &seed)
std::size_t operator()(T t) const
std::size_t operator()(const std::pair< T1, T2 > &p) const