From b2776402242195848dc21483b46e5e889dcf2e1d Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Mon, 7 Oct 2024 11:05:38 -0400 Subject: [PATCH] SharedLibrary::Handle no longer defines the hash function in std --- include/common/mir/shared_library.h | 15 ++++++++------- .../platform/mir/options/default_configuration.h | 4 ++-- src/common/sharedlibrary/shared_library.cpp | 6 ------ src/common/symbols.map | 9 +++++++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/common/mir/shared_library.h b/include/common/mir/shared_library.h index 5972635e2b2..cba7bd6fb40 100644 --- a/include/common/mir/shared_library.h +++ b/include/common/mir/shared_library.h @@ -57,9 +57,16 @@ class SharedLibrary auto operator<=>(Handle const& rhs) const -> std::strong_ordering; auto operator==(Handle const& rhs) const -> bool = default; auto operator!=(Handle const& rhs) const -> bool = default; + + struct HandleHash + { + std::size_t operator()(const Handle& h) const noexcept + { + return std::hash{}(h.handle); + } + }; private: friend class SharedLibrary; - friend struct std::hash; Handle(void* handle); void* handle; @@ -75,10 +82,4 @@ class SharedLibrary }; } -template<> -struct std::hash -{ - auto operator()(mir::SharedLibrary::Handle const& h) const noexcept -> std::size_t; -}; - #endif /* MIR_SHARED_LIBRARY_H_ */ diff --git a/include/platform/mir/options/default_configuration.h b/include/platform/mir/options/default_configuration.h index 0f60d707e07..22b6355e39a 100644 --- a/include/platform/mir/options/default_configuration.h +++ b/include/platform/mir/options/default_configuration.h @@ -77,8 +77,8 @@ class DefaultConfiguration : public Configuration std::function const unparsed_arguments_handler; std::shared_ptr const program_options; - std::unordered_map module_options_desc; - std::unordered_map> mutable module_options; + std::unordered_map module_options_desc; + std::unordered_map, SharedLibrary::Handle::HandleHash> mutable module_options; std::shared_ptr