Add util::hash_sequence
This commit is contained in:
parent
82607781cf
commit
24917370ea
1 changed files with 9 additions and 0 deletions
|
|
@ -16,6 +16,15 @@ namespace psemek::util
|
|||
seed = b * k;
|
||||
}
|
||||
|
||||
template <typename Iterator, typename Hash = std::hash<std::decay_t<decltype(*std::declval<Iterator>())>>>
|
||||
void hash_sequence(std::size_t & seed, Iterator begin, Iterator end, Hash hash = Hash{})
|
||||
{
|
||||
for (; begin != end; ++begin)
|
||||
{
|
||||
hash_combine(seed, hash(*begin));
|
||||
}
|
||||
}
|
||||
|
||||
struct any_hash
|
||||
{
|
||||
struct is_transparent{};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue