diff --git a/conanfile.py b/conanfile.py index 3aabf35b..4652389a 100644 --- a/conanfile.py +++ b/conanfile.py @@ -69,6 +69,7 @@ def requirements(self): self.requires("spdlog/1.11.0", transitive_headers=True, transitive_libs=True) # nlohmann_json: public headers include json.hpp and json_fwd.hpp self.requires("nlohmann_json/3.11.2", transitive_headers=True) + self.requires("20230125.3") if self.options.with_python: self.requires("pybind11/2.10.1") if self.options.with_testing: diff --git a/src/PROPOSAL/CMakeLists.txt b/src/PROPOSAL/CMakeLists.txt index 10cae9a9..27bcbb11 100644 --- a/src/PROPOSAL/CMakeLists.txt +++ b/src/PROPOSAL/CMakeLists.txt @@ -18,6 +18,7 @@ target_include_directories(PROPOSAL PUBLIC find_package(CubicInterpolation REQUIRED) find_package(spdlog REQUIRED) find_package(nlohmann_json REQUIRED) +find_package(absl REQUIRED) add_subdirectory(PROPOSAL) add_subdirectory(detail) @@ -26,6 +27,7 @@ target_link_libraries(PROPOSAL CubicInterpolation::CubicInterpolation spdlog::spdlog nlohmann_json::nlohmann_json + absl::hash ) install(TARGETS PROPOSAL EXPORT PROPOSALTargets diff --git a/src/PROPOSAL/PROPOSAL/methods.h b/src/PROPOSAL/PROPOSAL/methods.h index 8c274af9..26547ce0 100644 --- a/src/PROPOSAL/PROPOSAL/methods.h +++ b/src/PROPOSAL/PROPOSAL/methods.h @@ -34,6 +34,7 @@ #include #include #include +#include "absl/hash/hash.h" // use unistd.h for access on POSIX os, use io.h for windows systems // todo: use filesystem instead when switching to c++17 #ifdef _WIN32 @@ -77,7 +78,7 @@ inline void hash_combine(std::size_t& seed) { (void)seed; } template inline void hash_combine(std::size_t& seed, const T& v, Rest... rest) { - std::hash hasher; + absl::Hash hasher; seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2); hash_combine(seed, rest...); }