std::ranges::chunk_by_view<V,Pred>::iterator::operator++,--
From cppreference.cn
< cpp | ranges | chunk by view | iterator
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) |
递增或递减迭代器。
设 parent_
、 current_
和 next_
为 iterator 的适当底层(仅用于演示)数据成员。
设 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 的副本,该副本在更改前创建。