名稱空間
變體
操作

std::ranges::elements_view<V,F>::iterator<Const>::operator++,--,+=,-=

來自 cppreference.com
< cpp‎ | ranges‎ | elements view‎ | iterator
 
 
範圍庫 (Ranges library)
範圍介面卡 (Range adaptors)
 
 
constexpr /*迭代器*/& 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 的一個副本