Skip to content

Commit 7198928

Browse files
committed
Add static member function in __sentinel to access priavate member of __iterator
Comment: #65536 (comment)
1 parent 8ab29fb commit 7198928

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

libcxx/include/__ranges/join_with_view.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,8 @@ struct join_with_view<_View, _Pattern>::__sentinel {
407407
_LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(_Parent& __parent) : __end_(ranges::end(__parent.__base_)) {}
408408

409409
template <bool _OtherConst>
410-
requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
411-
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool __equal_to(const __iterator<_OtherConst>& __x) const {
412-
return __x.__get_outer() == __end_;
410+
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto& __get_outer_of(const __iterator<_OtherConst>& __x) {
411+
return __x.__get_outer();
413412
}
414413

415414
public:
@@ -423,7 +422,7 @@ struct join_with_view<_View, _Pattern>::__sentinel {
423422
requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
424423
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI friend constexpr bool
425424
operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
426-
return __y.__equal_to(__x);
425+
return __get_outer_of(__x) == __y.__end_;
427426
}
428427
};
429428

0 commit comments

Comments
 (0)