qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches
functional.h
Go to the documentation of this file.
1
25
26#ifndef QB_FUNCTIONAL_H
27#define QB_FUNCTIONAL_H
28#include <functional>
29
30namespace qb {
31
40template <typename T>
41void
42_hash_combine(size_t &seed, const T &val) {
43 seed ^= std::hash<T>()(val) + 0x9e3779b9 + (seed << 6u) + (seed >> 2u);
44}
45
81template <typename... Types>
82size_t
83hash_combine(const Types &...args) {
84 size_t seed = 0;
85 (_hash_combine(seed, args), ...); // create hash value with seed over all args
86 return seed;
87}
88} // namespace qb
89
90#endif // QB_FUNCTIONAL_H
size_t hash_combine(const Types &...args)
Combines the hash values of multiple objects into a single hash value.
Definition functional.h:83