std::ranges::cartesian_product_view<First, Vs...>::iterator<Const>::operator++,--,+=,-=
来自 cppreference.cn
< 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) |
执行迭代器算术 (函数) |