Namespaces
Variants

std::ranges::cartesian_product_view<First, Vs...>:: iterator <Const>:: operator++,--,+=,-=

From cppreference.net
Ranges library
Range adaptors
constexpr /*iterator*/ & operator ++ ( ) ;
(1) (自 C++23 起)
constexpr void operator ++ ( int ) ;
(2) (自 C++23 起)
constexpr /*iterator*/ operator ++ ( int )
requires ranges:: forward_range < /*maybe-const*/ < Const, First >> ;
(3) (自 C++23 起)
constexpr /*iterator*/ & operator -- ( )
requires /*cartesian-product-is-bidirectional*/ < Const, First, Vs... > ;
(4) (自 C++23 起)
constexpr /*iterator*/ operator -- ( int )
requires /*cartesian-product-is-bidirectional*/ < Const, First, Vs... > ;
(5) (自 C++23 起)
constexpr /*iterator*/ & operator + = ( difference_type n )
requires /*cartesian-product-is-random-access*/ < Const, First, Vs... > ;
(6) (自 C++23 起)
constexpr /*iterator*/ & operator - = ( difference_type n )
requires /*cartesian-product-is-random-access*/ < Const, First, Vs... > ;
(7) (自 C++23 起)

递增或递减 迭代器

current_ 表示底层的迭代器元组, parent_ 表示指向 cartesian_product_view 的底层指针。

1) 等价于 next ( ) ; return * this ;
2) 等价于 ++* this ;
3) 等价于 auto tmp = * this ; ++* this ; return tmp ;
4) 等价于 prev ( ) ; return * this ;
5) 等价于 auto tmp = * this ; --* this ; return tmp ;
6) * this 的值设置为 ret ,其中 ret 为:
  • n > 0 ,则为调用 next 函数 n 次后的 * this 值;否则
  • n < 0 ,则为调用 prev 函数 - n 次后的 * this 值;否则
  • 为调用前的 * this 值。
n 不在 [ ranges:: distance ( * this, ranges:: begin ( * parent_ ) ) , ranges:: distance ( * this, ranges:: end ( * parent_ ) ) ) 范围内,则行为未定义。
7) 等价于 * this + = - n ; return * this ;

目录

参数

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

返回值

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

复杂度

6) 常量。

示例

参见

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