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