Skip to content

Commit 9760ec3

Browse files
committed
Fix sentinel::operator==
Comment: #65536 (comment)
1 parent 0dc76bb commit 9760ec3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

libcxx/include/__ranges/join_with_view.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,12 @@ struct join_with_view<_View, _Pattern>::__sentinel {
404404

405405
_LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(_Parent& __parent) : __end_(ranges::end(__parent.__base_)) {}
406406

407+
template <bool _OtherConst>
408+
requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
409+
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr bool __equal_to(const __iterator<_OtherConst>& __x) const {
410+
return __x.__get_outer() == __end_;
411+
}
412+
407413
public:
408414
_LIBCPP_HIDE_FROM_ABI __sentinel() = default;
409415

@@ -415,7 +421,7 @@ struct join_with_view<_View, _Pattern>::__sentinel {
415421
requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
416422
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI friend constexpr bool
417423
operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
418-
return __x.__get_outer() == __y.__end_;
424+
return __y.__equal_to(__x);
419425
}
420426
};
421427

0 commit comments

Comments
 (0)