Add util::hash_all for creating a hash out of a bunch of objects

This commit is contained in:
Nikita Lisitsa 2024-05-21 13:21:01 +03:00
parent 713a479eed
commit c6f9fbd244

View file

@ -36,6 +36,15 @@ namespace psemek::util
}
};
template <typename ... T>
constexpr std::size_t hash_all(T const & ... x)
{
any_hash hash;
std::size_t seed = 0;
(hash_combine(seed, hash(x)), ...);
return seed;
}
}
namespace std