Skip to content

Commit 28f0935

Browse files
authored
[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.
1 parent c8fbcb6 commit 28f0935

File tree

1 file changed

+4
-27
lines changed

1 file changed

+4
-27
lines changed

libcxx/include/__node_handle

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -174,40 +174,17 @@ struct __set_node_handle_specifics {
174174
_LIBCPP_HIDE_FROM_ABI value_type& value() const { return static_cast<_Derived const*>(this)->__ptr_->__get_value(); }
175175
};
176176

177-
template <class, class>
178-
struct __hash_value_type;
179-
180177
template <class _NodeType, class _Derived>
181178
struct __map_node_handle_specifics {
182-
template <class _Tp>
183-
struct __get_type {
184-
using key_type = __remove_const_t<typename _Tp::first_type>;
185-
using mapped_type = typename _Tp::second_type;
186-
};
187-
188-
template <class _Key, class _Mapped>
189-
struct __get_type<__hash_value_type<_Key, _Mapped> > {
190-
using key_type = _Key;
191-
using mapped_type = _Mapped;
192-
};
193-
194-
using key_type = typename __get_type<typename _NodeType::__node_value_type>::key_type;
195-
using mapped_type = typename __get_type<typename _NodeType::__node_value_type>::mapped_type;
179+
using key_type = __remove_const_t<typename _NodeType::__node_value_type::first_type>;
180+
using mapped_type = typename _NodeType::__node_value_type::second_type;
196181

197182
_LIBCPP_HIDE_FROM_ABI key_type& key() const {
198-
if constexpr (__is_specialization_v<typename _NodeType::__node_value_type, __hash_value_type>) {
199-
return static_cast<_Derived const*>(this)->__ptr_->__get_value().__ref().first;
200-
} else {
201-
return const_cast<key_type&>(static_cast<_Derived const*>(this)->__ptr_->__get_value().first);
202-
}
183+
return const_cast<key_type&>(static_cast<_Derived const*>(this)->__ptr_->__get_value().first);
203184
}
204185

205186
_LIBCPP_HIDE_FROM_ABI mapped_type& mapped() const {
206-
if constexpr (__is_specialization_v<typename _NodeType::__node_value_type, __hash_value_type>) {
207-
return static_cast<_Derived const*>(this)->__ptr_->__get_value().__ref().second;
208-
} else {
209-
return static_cast<_Derived const*>(this)->__ptr_->__get_value().second;
210-
}
187+
return static_cast<_Derived const*>(this)->__ptr_->__get_value().second;
211188
}
212189
};
213190

0 commit comments

Comments
 (0)