From 2977e1b86bcbcda31041414736e5545c23e15a01 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 12 Nov 2024 17:32:42 +0100 Subject: target_cache_key: Move hash definition to class header --- src/buildtool/storage/target_cache.hpp | 9 --------- src/buildtool/storage/target_cache_key.hpp | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/buildtool/storage/target_cache.hpp b/src/buildtool/storage/target_cache.hpp index cfd8534e..a45d3999 100644 --- a/src/buildtool/storage/target_cache.hpp +++ b/src/buildtool/storage/target_cache.hpp @@ -162,13 +162,4 @@ using ActiveTargetCache = TargetCache; // NOLINTNEXTLINE(misc-header-include-cycle) #include "src/buildtool/storage/target_cache.tpp" -namespace std { -template <> -struct hash { - [[nodiscard]] auto operator()(TargetCacheKey const& k) const { - return std::hash{}(k.Id()); - } -}; -} // namespace std - #endif // INCLUDED_SRC_BUILDTOOL_STORAGE_TARGET_CACHE_HPP diff --git a/src/buildtool/storage/target_cache_key.hpp b/src/buildtool/storage/target_cache_key.hpp index e5d3ee1b..f4dc0586 100644 --- a/src/buildtool/storage/target_cache_key.hpp +++ b/src/buildtool/storage/target_cache_key.hpp @@ -38,4 +38,14 @@ class TargetCacheKey { Artifact::ObjectInfo id_; }; +namespace std { +template <> +struct hash { + [[nodiscard]] auto operator()(TargetCacheKey const& key) const noexcept + -> std::size_t { + return std::hash{}(key.Id()); + } +}; +} // namespace std + #endif // INCLUDED_SRC_BUILDTOOL_STORAGE_TARGET_CACHE_KEY_HPP -- cgit v1.2.3