次の方法で共有


checked_array_iterator::operator+

反復子にオフセットを追加し、新しいオフセット位置に挿入された要素を新しい checked_array_iterator アドレスを返します。

checked_array_iterator<_Iterator> operator+(
   difference_type _Off
) const;

パラメーター

  • _Off
    checked_array_iteratorに追加するオフセット。

戻り値

オフセットの要素を指定 checked_array_iterator

解説

詳細については、「チェックを行う反復子」を参照してください。

使用例

// checked_array_iterators_op_plus.cpp
// compile with: /EHsc
#include <vector>
#include <iostream>

int main() {
   using namespace stdext;
   using namespace std;
   int a[] = {6, 3, 77, 199, 222};
   int b[5];
   copy(a, a + 5, checked_array_iterator<int*>(b,5));

   checked_array_iterator<int*> checked_output_iterator(b,5);

   cout << *checked_output_iterator << endl;
   checked_output_iterator = checked_output_iterator + 3;
   cout << *checked_output_iterator << endl;
}
  

必要条件

ヘッダー: <iterator>

名前空間: の stdext

参照

関連項目

checked_array_iterator Class

標準テンプレート ライブラリ