Spec-Zone.ru › C++

std::ranges::zip_transform_view<F,Views...>::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<Base>;
(3) (since C++23)
constexpr /*iterator*/& operator--()
    requires ranges::bidirectional_range<Base>;
(4) (since C++23)
constexpr /*iterator*/ operator--( int )
    requires ranges::bidirectional_range<Base>;
(5) (since C++23)
constexpr /*iterator*/& operator+=( difference_type n )
    requires ranges::random_access_range<Base>;
(6) (since C++23)
constexpr /*iterator*/& operator-=( difference_type n )
    requires ranges::random_access_range<Base>;
(7) (since C++23)

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

Пусть inner_ является базовым итератором, а Base — вспомогательный тип.

Эквивалентно:

1) ++inner_; return *this;
2) ++*this;
3) auto tmp = *this; ++*this; return tmp;
4) --inner_; return *this;
5) auto tmp = *this; --*this; return tmp;
6) inner_ += n; return *this;
7) inner_ -= n; return *this;

Параметры

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

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

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

Пример

См. также

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/ranges/zip_transform_view/iterator/operator_arith

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API