checked_array_iterator::operator-=
從 checked_array_iterator 減去指定的位移。
checked_array_iterator<_Iterator>& operator-=(
difference_type _Off
);
參數
- _Off
用來遞增 Iterator 的位移。
傳回值
對 checked_array_iterator處理的元素的參考。
備註
如需詳細資訊,請參閱已檢查的迭代器。
範例
// checked_array_iterators_op_minus_eq.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);
checked_output_iterator += 3;
cout << *checked_output_iterator << endl;
checked_output_iterator -= 2;
cout << *checked_output_iterator << endl;
}
需求
標頭:<迭代器>
**命名空間:**stdext