std::ranges::chunk_by_view<V,Pred>::iterator::operator++,--
constexpr /*iterator*/& operator++(); | (1) | (since C++23) |
constexpr /*iterator*/ operator++(int); | (2) | (since C++23) |
constexpr /*iterator*/& operator--() requires ranges::bidirectional_range<V>; | (3) | (since C++23) |
constexpr /*iterator*/ operator--(int) requires ranges::bidirectional_range<V>; | (4) | (since C++23) |
Увеличивает или уменьшает итератор.
Пусть iterator имеет соответствующие (только для демонстрации) члены данных parent_, current_ и next_.
Пусть find-next и find-prev — соответствующие (только для демонстрации) члены функции класса ranges::chunk_by_view.
1) Эквивалентно:
current_ = next_; next_ = parent_->/*find-next*/(current_); return *this;
2) Эквивалентно:
auto tmp = *this; ++*this; return tmp;
3) Эквивалентно:
next_ = current_; current_ = parent_->/*find-prev*/(next_); return *this;
4) Эквивалентно:
auto tmp = *this; --*this; return tmp;
Параметры
(нет)
Возвращаемое значение
1,3)
*this
2,4) копия
*this, созданная до изменения.
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/ranges/chunk_by_view/iterator/operator_arith