std::ranges::cartesian_product_view<First, Vs...>::iterator<Const>::operator++,--,+=,-=
constexpr /*iterator*/& operator++(); |
(1) | (since C++23) |
constexpr void operator++( int ); |
(2) | (since C++23) |
constexpr /*iterator*/ operator++( int ) requires ranges::forward_range</*maybe-const*/<Const, First>>; |
(3) | (since C++23) |
constexpr /*iterator*/& operator--() requires /*cartesian-product-is-bidirectional*/<Const, First, Vs...>; |
(4) | (since C++23) |
constexpr /*iterator*/ operator--( int ) requires /*cartesian-product-is-bidirectional*/<Const, First, Vs...>; |
(5) | (since C++23) |
constexpr /*iterator*/& operator+=( difference_type n ) requires /*cartesian-product-is-random-access*/<Const, First, Vs...>; |
(6) | (since C++23) |
constexpr /*iterator*/& operator-=( difference_type n ) requires /*cartesian-product-is-random-access*/<Const, First, Vs...>; |
(7) | (since C++23) |
Инкрементирует или декрементирует итератор.
Пусть итератор обозначает лежащую в основе кортеж итераторов, а parent_ обозначает лежащий в основе указатель на cartesian_product_view.
1) Эквивалентно
next(); return *this;
2) Эквивалентно
++*this;
3) Эквивалентно
auto tmp = *this; ++*this; return tmp;
4) Эквивалентно
prev(); return *this;
5) Эквивалентно
6) Устанавливает значение auto tmp = *this; --*this; return tmp;
*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) Постоянная.
Пример
См. также
|
(C++23) |
выполняет арифметику итераторов (функция) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/ranges/cartesian_product_view/iterator/operator_arith