diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-11-12 17:32:42 +0100 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-11-14 12:53:58 +0100 |
commit | 2977e1b86bcbcda31041414736e5545c23e15a01 (patch) | |
tree | 6ea8f298dba4dc16bc06892f963dd9d7387aed9f | |
parent | 2bad4b844928986d21a57fdb8b223a5ab0fb90e3 (diff) | |
download | justbuild-2977e1b86bcbcda31041414736e5545c23e15a01.tar.gz |
target_cache_key: Move hash definition to class header
-rw-r--r-- | src/buildtool/storage/target_cache.hpp | 9 | ||||
-rw-r--r-- | src/buildtool/storage/target_cache_key.hpp | 10 |
2 files changed, 10 insertions, 9 deletions
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<true>; // NOLINTNEXTLINE(misc-header-include-cycle) #include "src/buildtool/storage/target_cache.tpp" -namespace std { -template <> -struct hash<TargetCacheKey> { - [[nodiscard]] auto operator()(TargetCacheKey const& k) const { - return std::hash<Artifact::ObjectInfo>{}(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<TargetCacheKey> { + [[nodiscard]] auto operator()(TargetCacheKey const& key) const noexcept + -> std::size_t { + return std::hash<Artifact::ObjectInfo>{}(key.Id()); + } +}; +} // namespace std + #endif // INCLUDED_SRC_BUILDTOOL_STORAGE_TARGET_CACHE_KEY_HPP |