Rochet2
2018-01-28 19:45:22 +02:00
parent 84b550c484
commit 8ffe06564e

View File

@@ -266,11 +266,11 @@ class hash_helper
public: public:
typedef std::size_t result_type; typedef std::size_t result_type;
template <typename... T> template <typename T1, typename T2, typename... T>
static inline result_type hash(T const &... t) static inline result_type hash(T1 const & t1, T2 const & t2, T const &... t)
{ {
result_type seed = 0; result_type seed = 0;
_hash_combine(seed, t...); _hash_combine(seed, t1, t2, t...);
return seed; return seed;
} }
@@ -294,11 +294,11 @@ private:
seed ^= hash(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2); seed ^= hash(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
} }
template <typename H, typename... T> template <typename H, typename T1, typename... T>
static inline void _hash_combine(result_type& seed, H const & h, T const &... t) static inline void _hash_combine(result_type& seed, H const & h, T1 const & t1, T const &... t)
{ {
_hash_combine(seed, h); _hash_combine(seed, h);
_hash_combine(seed, t...); _hash_combine(seed, t1, t...);
} }
}; };