std::ranges::elements_view<V,N>::iterator<Const>::operator++,--,+=,-=
来自cppreference.com
< cpp | ranges | elements view | iterator
范围库
std::ranges::elements_view
成员函数 | ||||
(C++20)
|
||||
(C++20)
|
||||
(C++20)
|
||||
(C++20)
|
||||
(C++20)
|
||||
嵌套类 | ||||
迭代器 | ||||
(C++20)
|
||||
elements_view::iterator::operator++
elements_view::iterator::operator++(int) elements_view::iterator::operator-- elements_view::iterator::operator--(int) elements_view::iterator::operator+= elements_view::iterator::operator-= (C++20)(C++20)(C++20)(C++20)(C++20)(C++20)
|
||||
哨位 | ||||
(C++20)
|
||||
constexpr
/*iterator*/&
operator++();
|
(1) | (C++20 起) |
constexpr
void
operator++(
int
);
|
(2) | (C++20 起) |
constexpr
/*iterator*/
operator++(
int
)
requires ranges::forward_range<Base>; |
(3) | (C++20 起) |
constexpr
/*iterator*/&
operator--()
requires ranges::bidirectional_range<Base>; |
(4) | (C++20 起) |
constexpr
/*iterator*/
operator--(
int
)
requires ranges::bidirectional_range<Base>; |
(5) | (C++20 起) |
constexpr
/*iterator*/&
operator+=(
difference_type n )
requires ranges::random_access_range<Base>; |
(6) | (C++20 起) |
constexpr
/*iterator*/&
operator-=(
difference_type n )
requires ranges::random_access_range<Base>; |
(7) | (C++20 起) |
增或减迭代器。
令 current_
为底层迭代器。
1) 等价于 ++current_; return *this;
2) 等价于 ++current_;
3) 等价于 auto tmp = *this; ++*this; return tmp;
4) 等价于 --current_; return *this;
5) 等价于 auto tmp = *this; --*this; return tmp;
6) 等价于 current_ +=
n; return *this;
7) 等价于 current_ -=
n; return *this;
参数
n | - | 相对于当前位置的位置 |
返回值
1,4,6,7) *this
2) (无)
3,5) 更改前的 *this 的副本