Skip to content

Commit 0e92ed3

Browse files
committed
iterator: operator-(iterator, diffType)
1 parent 507fcfb commit 0e92ed3

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
@@ -197,6 +197,12 @@ class cartesian_product_view<First, Vs...>::iterator {
197197
return y + x;
198198
}
199199

200+
friend constexpr iterator operator-(const iterator& x, difference_type y)
201+
requires cartesian_product_is_random_access<Const, First, Vs...>
202+
{
203+
return iterator(x) -= y;
204+
}
205+
200206
private:
201207
using Parent = __maybe_const<Const, cartesian_product_view>;
202208
Parent* parent_ = nullptr;

0 commit comments

Comments
 (0)