11template<
typename Container>
12requires requires (Container C) { {C.cbegin() < C.cend() } -> std::same_as<bool>; }
and
13 requires (Container C) { {C.cbegin() == C.cend() } -> std::same_as<bool>; }
and
14 requires (Container C) { {C.cbegin() != C.cend() } -> std::same_as<bool>; }
and
15 requires (Container C) { *C.cbegin(); }
19 using value_type =
decltype(*C.cbegin());
20 std::hash<std::decay_t<value_type>> h;
21 std::size_t value = 0xcbf29ce484222325UL;
23 for (
const auto &elem : C) {
25 value *= 0x100000001b3UL;
34struct hash<
std::reference_wrapper<T>>
36 std::size_t
operator()(std::reference_wrapper<T> ref)
const {
37 std::hash<std::decay_t<T>> h;
43bool operator==(std::reference_wrapper<T> left, std::reference_wrapper<T> right) {
return left.get() == right.get(); }
bool operator==(std::reference_wrapper< T > left, std::reference_wrapper< T > right)
and
Conveniance specialization to provide hasing of std::vector by computing a rolling hash over the elem...
std::size_t operator()(const Container &C) const
std::size_t operator()(std::reference_wrapper< T > ref) const