Namespaces
Variants

std::ranges::cartesian_product_view<First, Vs...>:: iterator <Const>:: operator++,--,+=,-=

From cppreference.net
Ranges library
Range adaptors
constexpr /*iterator*/ & operator ++ ( ) ;
(1) (начиная с C++23)
constexpr void operator ++ ( int ) ;
(2) (начиная с C++23)
constexpr /*iterator*/ operator ++ ( int )
requires ranges:: forward_range < /*maybe-const*/ < Const, First >> ;
(3) (начиная с C++23)
constexpr /*iterator*/ & operator -- ( )
requires /*cartesian-product-is-bidirectional*/ < Const, First, Vs... > ;
(4) (начиная с C++23)
constexpr /*iterator*/ operator -- ( int )
requires /*cartesian-product-is-bidirectional*/ < Const, First, Vs... > ;
(5) (начиная с C++23)
constexpr /*iterator*/ & operator + = ( difference_type n )
requires /*cartesian-product-is-random-access*/ < Const, First, Vs... > ;
(6) (начиная с C++23)
constexpr /*iterator*/ & operator - = ( difference_type n )
requires /*cartesian-product-is-random-access*/ < Const, First, Vs... > ;
(7) (начиная с C++23)

Увеличивает или уменьшает итератор .

Пусть current_ обозначает базовый кортеж итераторов, а parent_ обозначает базовый указатель на cartesian_product_view .

1) Эквивалентно next ( ) ; return * this ;
2) Эквивалентно ++* this ;
3) Эквивалентно auto tmp = * this ; ++* this ; return tmp ;
4) Эквивалентно prev ( ) ; return * this ;
5) Эквивалентно auto tmp = * this ; --* this ; return tmp ;
6) Устанавливает значение * this в ret , где ret равно:
  • если n > 0 , значению * this при условии, что next был вызван n раз. Иначе,
  • если n < 0 , значению * this при условии, что prev был вызван - n раз. Иначе,
  • значению * this до вызова.
Поведение не определено, если n не находится в диапазоне [ ranges:: distance ( * this, ranges:: begin ( * parent_ ) ) , ranges:: distance ( * this, ranges:: end ( * parent_ ) ) ) .
7) Эквивалентно * this + = - n ; return * this ; .

Содержание

Параметры

n - позиция относительно текущего местоположения

Возвращаемое значение

1,4,6,7) * this
2) (нет)
3,5) копия * this , созданная до изменения.

Сложность

6) Константа.

Пример

Смотрите также

выполняет арифметические операции с итераторами
(функция)