名稱空間
變體
操作

operator+(std::move_iterator)

來自 cppreference.com
 
 
迭代器庫
迭代器概念
(C++20)
迭代器原語
(C++17 中已棄用)


演算法概念與工具
間接可呼叫概念
常用演算法要求
(C++20)
(C++20)
(C++20)
工具
(C++20)
迭代器介面卡
範圍訪問
(C++11)(C++14)
(C++14)(C++14)  
(C++11)(C++14)
(C++14)(C++14)  
(C++17)(C++20)
(C++17)
(C++17)
 
 
定義於標頭檔案 <iterator>
template< class Iter >

move_iterator<Iter> operator+
    ( typename move_iterator<Iter>::difference_type n,

      const move_iterator<Iter>& it );
(C++11 起)
(自 C++17 起為 constexpr)
(C++20 前)
template< class Iter >

constexpr move_iterator<Iter> operator+

    ( std::iter_difference_t<Iter> n, const move_iterator<Iter>& it );
(C++20 起)

返回迭代器 it 遞增 n 位後的結果。

僅當 it.base() + n 形式良好且型別為 Iter 時,此過載才參與過載決議。

(C++20 起)

目錄

[編輯] 引數

n - 迭代器要遞增的位置數
it - 要遞增的迭代器介面卡

[編輯] 返回值

it + n

[編輯] 示例

[編輯] 缺陷報告

下列更改行為的缺陷報告追溯地應用於以前出版的 C++ 標準。

缺陷報告 應用於 釋出時的行為 正確的行為
LWG 3293 C++20 非成員 operator+ 被限制為
要求 it + n 形式良好且型別為 Iter
更改為
it.base() + n

[編輯] 參閱

遞增或遞減 move_iterator
(public member function) [編輯]
(C++11)
計算兩個迭代器介面卡之間的距離
(function template) [編輯]