lsst.utils  15.0-3-g9103c06+6
hashCombine.h
Go to the documentation of this file.
1 #ifndef LSST_UTILS_HASH_COMBINE_H
2 #define LSST_UTILS_HASH_COMBINE_H
3 
4 #include <functional>
5 
6 namespace lsst {
7 namespace utils {
8 
10 
24 inline std::size_t hashCombine(std::size_t seed) { return seed; }
25 
26 template <typename T, typename... Rest>
27 std::size_t hashCombine(std::size_t seed, const T& value, Rest... rest) {
28  std::hash<T> hasher;
29  seed ^= hasher(value) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
30  return hashCombine(seed, rest...);
31 }
33 
34 }} // namespace lsst::utils
35 
36 #endif
Forward declarations for lsst::utils::Cache.
std::size_t hashCombine(std::size_t seed)
Combine hashes.
Definition: hashCombine.h:24