qb
2.0.0.0
C++17 Actor Framework
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
30
namespace
qb {
31
40
template
<
typename
T>
41
void
42
_hash_combine(
size_t
&seed,
const
T &val) {
43
seed ^= std::hash<T>()(val) + 0x9e3779b9 + (seed << 6u) + (seed >> 2u);
44
}
45
81
template
<
typename
... Types>
82
size_t
83
hash_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
qb::hash_combine
size_t hash_combine(const Types &...args)
Combines the hash values of multiple objects into a single hash value.
Definition
functional.h:83
include
qb
utility
functional.h
Generated by
1.14.0