Unfortunately, std::hash provides no way to combine hashes, so everyone is copying boost::hash_combine. This is a version that follows Google's guidelines on the arguments, and contains only the combination, without hashing.
| 27 | // guidelines on the arguments, and contains only the combination, without |
| 28 | // hashing. |
| 29 | inline void CombineHash(size_t from, size_t* to) { |
| 30 | *to ^= from + 0x9e3779b9 + (*to << 6) + (*to >> 2); |
| 31 | } |
| 32 | |
| 33 | // Combine two hashes in such a way that the order of combination doesn't matter |
| 34 | // (so it's really both commutative and associative). The result is not a very |
no outgoing calls