std::ranges::cartesian_product_view<First, Vs...>:: iterator <Const>:: operator++,--,+=,-=
From cppreference.net
<
cpp
|
ranges
|
cartesian product view
|
iterator
|
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
不在
[
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)
常量。
示例
|
本节内容不完整
原因:缺少示例 |
参见
|
(C++23)
|
执行迭代器算术运算
(函数) |