duckstation

duckstation, but archived from the revision just before upstream changed it to a proprietary software project, this version is the libre one
git clone https://git.neptards.moe/u3shit/duckstation.git
Log | Files | Refs | README | LICENSE

hash_combine.h (337B)


      1 // https://stackoverflow.com/questions/2590677/how-do-i-combine-hash-values-in-c0x
      2 #pragma once
      3 #include <functional>
      4 
      5 template<typename T, typename... Rest>
      6 void hash_combine(std::size_t& seed, const T& v, const Rest&... rest)
      7 {
      8   seed ^= std::hash<T>{}(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
      9   (hash_combine(seed, rest), ...);
     10 }