Skip to content

Commit bed849d

Browse files
map.ops/equal_range.pass.cpp
1 parent 64b93db commit bed849d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

libcxx/include/__tree

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -794,9 +794,9 @@ public:
794794

795795
private:
796796
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit __tree_const_iterator(__node_pointer __p) _NOEXCEPT
797-
: __ptr_(__p) {}
797+
: __ptr_(std::__static_fancy_pointer_cast<__end_node_pointer>(__p)) {}
798798
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit __tree_const_iterator(__end_node_pointer __p) _NOEXCEPT
799-
: __ptr_(__p) {}
799+
: __ptr_(std::__static_fancy_pointer_cast<__end_node_pointer>(__p)) {}
800800
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_pointer __get_np() const {
801801
return std::__static_fancy_pointer_cast<__node_pointer>(__ptr_);
802802
}
@@ -2328,13 +2328,13 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26
23282328
__node_pointer __rt = __root();
23292329
while (__rt != nullptr) {
23302330
if (value_comp()(__k, __rt->__value_)) {
2331-
__result = static_cast<__end_node_pointer>(__rt);
2332-
__rt = static_cast<__node_pointer>(__rt->__left_);
2331+
__result = std::__static_fancy_pointer_cast<__end_node_pointer>(__rt);
2332+
__rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__left_);
23332333
} else if (value_comp()(__rt->__value_, __k))
2334-
__rt = static_cast<__node_pointer>(__rt->__right_);
2334+
__rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__right_);
23352335
else
23362336
return _Pp(iterator(__rt),
2337-
iterator(__rt->__right_ != nullptr ? static_cast<__end_node_pointer>(std::__tree_min(__rt->__right_))
2337+
iterator(__rt->__right_ != nullptr ? std::__static_fancy_pointer_cast<__end_node_pointer>(std::__tree_min(__rt->__right_))
23382338
: __result));
23392339
}
23402340
return _Pp(iterator(__result), iterator(__result));
@@ -2350,15 +2350,15 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) const {
23502350
__node_pointer __rt = __root();
23512351
while (__rt != nullptr) {
23522352
if (value_comp()(__k, __rt->__value_)) {
2353-
__result = static_cast<__end_node_pointer>(__rt);
2354-
__rt = static_cast<__node_pointer>(__rt->__left_);
2353+
__result = std::__static_fancy_pointer_cast<__end_node_pointer>(__rt);
2354+
__rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__left_);
23552355
} else if (value_comp()(__rt->__value_, __k))
2356-
__rt = static_cast<__node_pointer>(__rt->__right_);
2356+
__rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__right_);
23572357
else
23582358
return _Pp(
23592359
const_iterator(__rt),
23602360
const_iterator(
2361-
__rt->__right_ != nullptr ? static_cast<__end_node_pointer>(std::__tree_min(__rt->__right_)) : __result));
2361+
__rt->__right_ != nullptr ? std::__static_fancy_pointer_cast<__end_node_pointer>(std::__tree_min(__rt->__right_)) : __result));
23622362
}
23632363
return _Pp(const_iterator(__result), const_iterator(__result));
23642364
}

0 commit comments

Comments
 (0)