Browse Source

fix std::hash & std::eq of some types

V2
Zhicheng Wang 2 days ago
parent
commit
f7c23f7fba
  1. 7
      network_process/interface/fwd_types.hpp

7
network_process/interface/fwd_types.hpp

@ -207,6 +207,11 @@ struct polygon_face_t {
namespace std namespace std
{ {
template <>
struct hash<compact_bg_mesh_coord_t> {
size_t operator()(const compact_bg_mesh_coord_t& coord) const { return static_cast<size_t>(coord.hashed_value); }
};
template <> template <>
struct hash<vertex_header_t> { struct hash<vertex_header_t> {
size_t operator()(const vertex_header_t& v) const { return XXH3_64bits(&v, sizeof(vertex_header_t)); } size_t operator()(const vertex_header_t& v) const { return XXH3_64bits(&v, sizeof(vertex_header_t)); }
@ -256,7 +261,7 @@ template <size_t N>
struct equal_to<pod_key_t<N>> { struct equal_to<pod_key_t<N>> {
bool operator()(const pod_key_t<N>& k1, const pod_key_t<N>& k2) const bool operator()(const pod_key_t<N>& k1, const pod_key_t<N>& k2) const
{ {
return static_cast<std::array<uint32_t, N>>(k1) == static_cast<std::array<uint32_t, N>>(k2); return static_cast<std::array<uint64_t, N>>(k1) == static_cast<std::array<uint64_t, N>>(k2);
} }
}; };
} // namespace std } // namespace std

Loading…
Cancel
Save