11 std::size_t _vector_hash_impl(
const std::vector<T>& data)
19 using SVType = std::string_view::value_type;
20 static_assert(
sizeof(T) %
sizeof(SVType) == 0);
21 constexpr
static size_t size_ratio =
sizeof(T) /
sizeof(SVType);
23 std::string_view view(
reinterpret_cast<const SVType*
>(data.data()), size_ratio * data.size());
24 return std::hash<std::string_view>{}(view);
30 return _vector_hash_impl(data);
34 return _vector_hash_impl(data);
38 return _vector_hash_impl(data);
42 return _vector_hash_impl(data);
46 std::vector<size_t> hashes;
47 std::transform(data.begin(), data.end(), std::back_inserter(hashes), [](
const Rational& r) {
48 std::vector<size_t> v;
49 std::hash<std::string> h;
50 v.emplace_back(h(r.serialize()));
52 return vector_hash(v);
std::size_t vector_hash(const std::vector< size_t > &data)