命名空间
变体
操作

std::ranges::chunk_view<V>::iterator<Const>::operator++,--,+=,-=

来自 cppreference.cn
< cpp‎ | ranges‎ | chunk view‎ | iterator
 
 
范围库 (Ranges library)
范围适配器 (Range adaptors)
 
std::ranges::chunk_view
成员函数
input_range 的类
推导指引
outer-iterator
outer-iterator::value_type
inner-iterator
 
constexpr /*迭代器*/& operator++();
(1) (C++23 起)
constexpr /*iterator*/ operator++( int );
(2) (C++23 起)
constexpr /*iterator*/& operator--()
    requires ranges::bidirectional_range<Base>;
(3) (C++23 起)
constexpr /*iterator*/ operator--( int )
    requires ranges::bidirectional_range<Base>;
(4) (C++23 起)
constexpr /*iterator*/& operator+=( difference_type x )
    requires ranges::random_access_range<Base>;
(5) (C++23 起)
constexpr /*iterator*/& operator-=( difference_type x )
    requires ranges::random_access_range<Base>;
(6) (C++23 起)

前进或后退迭代器

current_end_n_chunk_view::iterator 的底层数据成员

1) 等价于
missing_ = ranges::advance(current_, n_, end_);
return *this;
调用前,表达式 current_ != end_ 必须为 true,否则行为未定义。
2) 等价于:auto tmp = *this; ++*this; return tmp;
3) 等效于
ranges::advance(current_, missing_ - n_);
missing_ = 0;
return *this;
4) 等价于:auto tmp = *this; --*this; return tmp;
5) 等同于
if (x > 0)
{
    ranges::advance(current_, n_ * (x - 1));
    missing_ = ranges::advance(current_, n_, end_);
}
else if (x < 0)
{
    ranges::advance(current_, n_ * x + missing_);
    missing_ = 0;
}
return *this;
x 为正,则在调用前表达式 ranges::distance(current_, end_) > n_ * (x - 1) 必须为 true(即,通俗地说,所请求的块应在底层序列的“内部”)。若 x 为负,此前置条件始终满足。
6) 等价于:return *this += -x;

目录

[编辑] 参数

x - 一个相对于当前位置的位置

[编辑] 返回值

1,3,5,6) *this
2,4) 改变前 *this 的副本

[编辑] 示例

[编辑] 参阅

进行迭代器算术
(函数)