checked_array_iterator::operator[]
위치의 지정된 수로 checked_array_iterator 으로 지정된 요소로 부터 요소 오프셋을 참조를 반환합니다.
reference operator[](
difference_type_Off
) const;
매개 변수
- _Off
The offset from the checked_array_iterator address.
반환 값
The reference to the element offset.
설명
자세한 내용은 Checked Iterators을 참조하십시오.
예제
// 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;
}
3
요구 사항
헤더: <iterator>
네임스페이스: stdext