1 #ifndef VCSN_MISC_HASH_HH
2 # define VCSN_MISC_HASH_HH
11 inline void hash_combine(std::size_t& seed,
const T& v)
14 seed ^= hasher(v) + 0x9e3779b9 + (seed<<6) + (seed>>2);
25 template <
typename ValueSet>
26 class equal_to :
public std::equal_to<typename ValueSet::value_t>
30 using value_t =
typename valueset_t::value_t;
34 return valueset_t::equals(v1, v2);
41 template <
typename ValueSet>
46 using value_t =
typename valueset_t::value_t;
50 return valueset_t::hash(v);
69 #endif // !VCSN_MISC_HASH_HH
typename valueset_t::value_t value_t
std::size_t hash_value(const T &v)
bool operator()(const value_t &v1, const value_t &v2) const
typename valueset_t::value_t value_t
size_t operator()(const value_t &v) const
This is useful to make hashes with labels or weights as keys without using non-default constructors; ...
This is useful to make hashes with labels or weights as keys without using non-default constructors; ...