CMS 3D CMS Logo

hash_combine.h
Go to the documentation of this file.
1 #ifndef FWCore_Utilities_hash_combine_h
2 #define FWCore_Utilities_hash_combine_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Utilities
6 // Class : hash_combine
7 //
20 // system include files
21 #include <functional>
22 
23 namespace edm {
24  template <typename T>
25  inline void hash_combine(std::size_t& seed, const T& val) {
26  seed ^= std::hash<T>()(val) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
27  }
28 
29  template <typename T, typename... Types>
30  inline void hash_combine(std::size_t& seed, const T& val, const Types&... args) {
32  hash_combine(seed, args...);
33  }
34 
35  template <typename... Types>
36  inline std::size_t hash_value(const Types&... args) {
37  std::size_t seed{0};
38  hash_combine(seed, args...);
39  return seed;
40  }
41 } // namespace edm
42 
43 #endif
edm::hash_value
std::size_t hash_value(const Types &... args)
Definition: hash_combine.h:36
writedatasetfile.args
args
Definition: writedatasetfile.py:18
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::hash_combine
void hash_combine(std::size_t &seed, const T &val)
Definition: hash_combine.h:25
fileCollector.seed
seed
Definition: fileCollector.py:127
Types
Definition: Types.py:1
heppy_batch.val
val
Definition: heppy_batch.py:351
T
long double T
Definition: Basic3DVectorLD.h:48