From 28f093517232fd3c1dff6103e7cc944a8e8253bc Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Thu, 10 Jul 2025 09:21:46 +0200 Subject: [PATCH] [libc++][NFC] Remove special handling for __hash_value_type in <__node_handle> (#147271) We're not instantiating `__hash_value_type` anymore, so we don't need any special handling of it here. --- libcxx/include/__node_handle | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/libcxx/include/__node_handle b/libcxx/include/__node_handle index 5c559c657ef5..b20b0c73a051 100644 --- a/libcxx/include/__node_handle +++ b/libcxx/include/__node_handle @@ -174,40 +174,17 @@ struct __set_node_handle_specifics { _LIBCPP_HIDE_FROM_ABI value_type& value() const { return static_cast<_Derived const*>(this)->__ptr_->__get_value(); } }; -template -struct __hash_value_type; - template struct __map_node_handle_specifics { - template - struct __get_type { - using key_type = __remove_const_t; - using mapped_type = typename _Tp::second_type; - }; - - template - struct __get_type<__hash_value_type<_Key, _Mapped> > { - using key_type = _Key; - using mapped_type = _Mapped; - }; - - using key_type = typename __get_type::key_type; - using mapped_type = typename __get_type::mapped_type; + using key_type = __remove_const_t; + using mapped_type = typename _NodeType::__node_value_type::second_type; _LIBCPP_HIDE_FROM_ABI key_type& key() const { - if constexpr (__is_specialization_v) { - return static_cast<_Derived const*>(this)->__ptr_->__get_value().__ref().first; - } else { - return const_cast(static_cast<_Derived const*>(this)->__ptr_->__get_value().first); - } + return const_cast(static_cast<_Derived const*>(this)->__ptr_->__get_value().first); } _LIBCPP_HIDE_FROM_ABI mapped_type& mapped() const { - if constexpr (__is_specialization_v) { - return static_cast<_Derived const*>(this)->__ptr_->__get_value().__ref().second; - } else { - return static_cast<_Derived const*>(this)->__ptr_->__get_value().second; - } + return static_cast<_Derived const*>(this)->__ptr_->__get_value().second; } };