27 inline void __hashCombine(std::size_t& seed) {}
29 template<
typename T,
typename... Rest>
30 inline void __hashCombine(std::size_t& seed, T
const& v, Rest... rest)
33 seed ^= hasher(v) + 0x9e3779b9 + (seed<<6) + (seed>>2);
34 __hashCombine(seed, rest...);
39 template<
typename T,
typename... Rest>
40 auto hashCombine(std::size_t seed, T
const& v, Rest... rest) -> std::size_t
42 __hashCombine(seed, v, rest...);
48 template<
typename Vec>
51 std::size_t seed = vec.size();
52 for(
auto const& val : vec)
60 template<
typename T,
typename A>
61 struct std::hash<std::vector<T, A>>
63 std::size_t operator()(std::vector<T, A>
const& obj)
const
70 template<
typename L,
typename R>
71 struct std::hash<std::pair<L, R>>
73 std::size_t operator()(std::pair<L, R>
const& obj)
const
The namespace containing all components of the Reaktoro library.
Definition: Algorithms.hpp:29
std::vector< T > Vec
Convenient alias for std::vector<T>.
Definition: Types.hpp:66
auto hashCombine(std::size_t seed, T const &v, Rest... rest) -> std::size_t
Return the hash combine of the hash number of given values.
Definition: HashUtils.hpp:40
auto hashVector(Vec const &vec) -> std::size_t
Return the hash of a vector of values.
Definition: HashUtils.hpp:49