operator+(std::move_iterator)
ja.cppreference.net より
| ヘッダ <iterator>
|
||
template< class Iter >
move_iterator<Iter> operator+
( typename move_iterator<Iter>::difference_type n,
const move_iterator<Iter>& it );
|
で定義(C++11 から) (constexpr, C++17 から) (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 だけ増分したものを返します。
|
このオーバーロードは、 |
(C++20 から) |
パラメータ
| n | - | イテレータをインクリメントする位置の数 |
| it | - | インクリメントするイテレータアダプタ |
戻り値
it + n
例
|
このセクションは不完全です
理由: 例がありません |
不具合報告
以下の動作変更の欠陥報告書は、以前に公開されたC++規格に対して遡及的に適用されました。
| DR | 適用対象 | 公開時の動作 | 正しい動作 |
|---|---|---|---|
| LWG 3293 | C++20 |
非メンバーの
operator
+
は
it + n が well-formed で型
Iter
を持つことを要求するように制約されていた
|
以下のように変更
it. base ( ) + n |
関連項目
move_iteratorを進めるまたは戻す
(公開メンバ関数) |
|
|
(C++11)
|
2つのイテレータアダプタ間の距離を計算する
(関数テンプレート) |