operator+(std::move_iterator)
來自 cppreference.com
定義於標頭檔案 <iterator> |
||
template< class Iter > move_iterator<Iter> operator+ |
(C++11 起) (自 C++17 起為 constexpr) (C++20 前) |
|
template< class Iter > constexpr move_iterator<Iter> operator+ |
(C++20 起) | |
返回迭代器 it 遞增 n 位後的結果。
僅當 it.base() + n 形式良好且型別為 |
(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) |