operator+,-(ranges::concat_view::iterator)
friend constexpr /*iterator*/
operator+( const /*iterator*/& it, difference_type n )
requires /*concat-is-random-access*/<Const, Views...>;
| (1) | (since C++26) |
friend constexpr /*iterator*/
operator+( difference_type n, const /*iterator*/& it )
requires /*concat-is-random-access*/<Const, Views...>;
| (2) | (since C++26) |
friend constexpr /*iterator*/
operator-( const /*iterator*/& it, difference_type n )
requires /*concat-is-random-access*/<Const, Views...>;
| (3) | (since C++26) |
friend constexpr difference_type
operator-( const /*iterator*/& x, const /*iterator*/& y )
requires /*concat-is-random-access*/<Const, Views...>;
| (4) | (since C++26) |
friend constexpr difference_type
operator-( const /*iterator*/& x, std::default_sentinel_t )
requires /* see description */;
| (5) | (since C++26) |
friend constexpr difference_type
operator-( std::default_sentinel_t, const /*iterator*/& x )
requires /* see description */;
| (6) | (since C++26) |
Increments or decrements the iterator.
auto t = it; t += n; return t;.return it + n;.auto t = it; t -= n; return t;.Ix be x.it_ .index() and Iy be y.it_ .index(): - If
Ix > Iyistrue, equivalent todifference_typeresult=ranges::distance(y.get-iter <Iy>(),y.get-end <Iy>());.
for(std::size_tI=Iy+1;I<Ix;I++)
result+=ranges::distance(x.get-view <I>());
returnresult+ranges::distance(x.get-begin <Ix>(),x.get-iter <Ix>()); - Otherwise, if
Ix < Iyistrue, equivalent toreturn -(y - x);. - Otherwise, equivalent to
returnx.get-iter <Ix>()-y.get-iter <Iy>();.
x.it_ .valueless_by_exception()||y.it_ .valueless_by_exception() is true, the behavior is undefined.Ix be x.it_ .index(), equivalent to difference_typeresult=ranges::distance(x.get-iter <Ix>(),x.get-end <Ix>());
for(std::size_tI=Ix+1,count=sizeof...(Views);I<count;I++)
result+=ranges::distance(x.get-view <I>());
return-result;.Fs be the pack that consists of all elements of Views except the first element, the expression in the requires clause is equivalent to (std::sized_sentinel_for<ranges::sentinel_t<maybe-const <Const,Views>>,
ranges::iterator_t<maybe-const <Const,Views>>>&&...)&&
(ranges::sized_range<maybe-const <Const,Fs>>&&...)
.x.it_ .valueless_by_exception() is true, the behavior is undefined.return -(x - std::default_sentinel);.Fs be the pack that consists of all elements of Views except the first element, the expression in the requires clause is equivalent to (std::sized_sentinel_for<ranges::sentinel_t<maybe-const <Const,Views>>,
ranges::iterator_t<maybe-const <Const,Views>>>&&...)&&
(ranges::sized_range<maybe-const <Const,Fs>>&&...)
.x.it_ .valueless_by_exception() is true, the behavior is undefined.These functions are not visible to ordinary unqualified or qualified lookup, and can only be found by argument-dependent lookup when concat_view::iterator <Const> is an associated class of the arguments.
Parameters
| it, x, y | - | the iterators |
| n | - | a position relative to current location |
Return value
As described above.
Example
See also
| 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/cpp/ranges/concat_view/iterator/operator_arith2