Forked from
Core Modules / dune-common
Source project has a limited visibility.
-
Steffen Müthing authored
As Carsten pointed out, the hash combining algorithms doesn't work correctly for 32-bit platforms because it uses a multiplication with a 64-bit constant. This patch adds a switch for picking different algorithms based on the size of std::size_t using a new struct hash_combiner that is templated on the size of std::size_t. Right now, there are implementations for 64-bit and 32-bit platforms, both based on CityHash.
Steffen Müthing authoredAs Carsten pointed out, the hash combining algorithms doesn't work correctly for 32-bit platforms because it uses a multiplication with a 64-bit constant. This patch adds a switch for picking different algorithms based on the size of std::size_t using a new struct hash_combiner that is templated on the size of std::size_t. Right now, there are implementations for 64-bit and 32-bit platforms, both based on CityHash.