다음을 통해 공유


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

표준 템플릿 라이브러리