Add util::hash_all for creating a hash out of a bunch of objects
This commit is contained in:
parent
713a479eed
commit
c6f9fbd244
1 changed files with 9 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue