次の方法で共有


checked_array_iterator::operator

位置の指定した数による checked_array_iterator によってアドレス要素から要素のオフセットへの参照を返します。

reference operator[](
   difference_type_Off
) const;

パラメーター

  • _Off
    checked_array_iterator のアドレスからのオフセット。

戻り値

要素のオフセットへの参照。

解説

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

使用例

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

int main() {
   using namespace std;   
   int V1[10];

   for (int i = 0; i < 10 ; i++)
      V1[i] = i;

   // Declare a difference type for a parameter
   stdext::checked_array_iterator<int*>::difference_type diff = 2;

   stdext::checked_array_iterator<int*> VChkIter(V1, 10);

   stdext::checked_array_iterator<int*>::reference refrpos = VChkIter [diff];

   cout << refrpos + 1 << endl;
}
  

必要条件

ヘッダー: <iterator>

名前空間: の stdext

参照

関連項目

checked_array_iterator Class

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