std::ranges::cartesian_product_view<First, Vs...>::iterator<Const>::operator++,--,+=,-=
來自 cppreference.com
< cpp | ranges | cartesian product view | iterator
constexpr /*迭代器*/& 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) |
進行迭代器算術 (函式) |