Skip to content

Commit ee0cf25

Browse files
committed
iterator: operator-(sentinel, iterator)
1 parent 018a50c commit ee0cf25

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libcxx/include/__ranges/cartesian_product_view.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,12 @@ class cartesian_product_view<First, Vs...>::iterator {
228228
return i.distance_from(end_tuple);
229229
}
230230

231+
friend constexpr difference_type operator-(default_sentinel_t s, const iterator& i)
232+
requires cartesian_is_sized_sentinel<Const, sentinel_t, First, Vs...>
233+
{
234+
return -(i - s);
235+
}
236+
231237
private:
232238
using Parent = __maybe_const<Const, cartesian_product_view>;
233239
Parent* parent_ = nullptr;

0 commit comments

Comments
 (0)