friend constexpr /*iterator*/ operator+( const /*iterator*/& i, difference_type n ) requires std::random_access_range<Base>; | (1) | (since C++23) |
friend constexpr /*iterator*/ operator+( difference_type n, const /*iterator*/& i ) requires std::random_access_range<Base>; | (2) | (since C++23) |
friend constexpr /*iterator*/ operator-( const /*iterator*/& i, difference_type n ) requires std::random_access_range<Base>; | (3) | (since C++23) |
friend constexpr difference_type operator-( const /*iterator*/& x, const /*iterator*/& y ) requires std::sized_sentinel_for<ranges::iterator_t<Base>, ranges::iterator_t<Base>>; | (4) | (since C++23) |
friend constexpr difference_type operator-( std::default_sentinel_t, const /*iterator*/& x ) requires std::sized_sentinel_for<ranges::sentinel_t<Base>, ranges::iterator_t<Base>>; | (5) | (since C++23) |
friend constexpr difference_type operator-( const /*iterator*/& x, std::default_sentinel_t s ) requires std::sized_sentinel_for<ranges::sentinel_t<Base>, ranges::iterator_t<Base>>; | (6) | (since C++23) |
Increments or decrements the iterator.
Let current_
, end_
, stride_
, and missing_
be the data members of the iterator.
auto r = i; r += n; return r;
.auto r = i; r -= n; return r;
.N
be x.current_ - y.current_
. Returns: (N + x.missing_ - y.missing_) / x.stride_
, if Base
models forward_range
. -/*div-ceil*/(-N, x.stride_)
, if N < 0
. /*div-ceil*/(N, x.stride_)
otherwise.return /*div-ceil*/(x.end_ - x.current_, x.stride_);
.return -(s - x);
.These functions are not visible to ordinary unqualified or qualified lookup, and can only be found by argument-dependent lookup when stride_view::iterator<Const>
is an associated class of the arguments.
x, y, i | - | the iterators |
s | - | a sentinel |
(C++23) | advances or decrements the underlying iterator (public member function) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/ranges/stride_view/iterator/operator_arith2