Namespaces
Variants

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

From cppreference.net
Ranges library
Range adaptors
constexpr /*iterator*/ & 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 n )
requires ranges:: random_access_range < Base > ;
(5) (自 C++23 起)
constexpr /*iterator*/ & operator - = ( difference_type n )
requires ranges:: random_access_range < Base > ;
(6) (自 C++23 起)

前进或递减 迭代器

current_ last_ele_ 作为指向滑动窗口起始与末尾的底层迭代器。

1) 等价于:
current_ = ranges::next(current_);
last_ele_ = ranges::next(last_ele_); // if last_ele_ is present
return *this;
在调用前, current_ last_ele_ (如果存在)必须可递增。
2) 等价于: auto tmp = * this ; ++* this ; return tmp ;
3) 等价于:
current_ = ranges::prev(current_);
last_ele_ = ranges::prev(last_ele_); // 如果 last_ele_ 存在
return *this;
在调用前, current_ last_ele_ (如果存在)必须可递减。
4) 等价于: auto tmp = * this ; --* this ; return tmp ;
5) 等价于:
current_ = current_ + n;
last_ele_ = last_ele_ + n; // if last_ele_ is present
return *this;
在调用前,表达式 current_ + n last_ele_ + n (若 last_ele_ 存在)必须具有明确定义的行为。
6) 等价于:
current_ = current_ - n;
last_ele_ = last_ele_ - n; // if last_ele_ is present
return *this;
在调用前,表达式 current_ - n last_ele_ - n (若 last_ele_ 存在)必须具有明确定义的行为。

目录

参数

n - 相对于当前位置的偏移量

返回值

1,3,5,6) * this
2,4) 在更改前创建的 * this 副本

示例

参见

执行迭代器算术运算
(函数)