From bbe937a0d1d90833d970168fb852a25c4eaaa3a3 Mon Sep 17 00:00:00 2001 From: mckay Date: Tue, 24 Jun 2025 16:20:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=20compact=5Fbg=5Fmesh=5Fcoord=5Ft=20?= =?UTF-8?q?=E6=8F=90=E4=BE=9B=20std::hash=20=E7=89=B9=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- network_process/interface/fwd_types.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/network_process/interface/fwd_types.hpp b/network_process/interface/fwd_types.hpp index 94cc6db..ce04a2c 100644 --- a/network_process/interface/fwd_types.hpp +++ b/network_process/interface/fwd_types.hpp @@ -227,6 +227,17 @@ struct hash> { size_t operator()(const pod_key_t& k) const { return XXH3_64bits(&k, sizeof(pod_key_t)); } }; +template <> +struct hash { + using argument_type = compact_bg_mesh_coord_t; + using result_type = size_t; + + result_type operator()(const argument_type& coord) const noexcept { + // 使用 uint64_t 的哈希算法,将 hashed_value 映射为 size_t + return static_cast(std::hash()(coord.hashed_value)); + } +}; + template <> struct equal_to { bool operator()(const vertex_header_t& v1, const vertex_header_t& v2) const