mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-23 22:53:43 +00:00
[generator] Implement hash for OsmElement::Tag
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
This commit is contained in:
@@ -146,3 +146,13 @@ std::string DebugPrintID(OsmElement const & element);
|
||||
std::string DebugPrint(OsmElement const & element);
|
||||
std::string DebugPrint(OsmElement::EntityType type);
|
||||
std::string DebugPrint(OsmElement::Tag const & tag);
|
||||
|
||||
template <>
|
||||
struct std::hash<OsmElement::Tag>
|
||||
{
|
||||
using is_avalanching = void;
|
||||
auto operator()(OsmElement::Tag const & tag) const noexcept -> std::uint64_t {
|
||||
std::string const str = tag.m_key + tag.m_value;
|
||||
return ankerl::unordered_dense::detail::wyhash::hash(str.data(), sizeof(char) * str.size());
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user