checked_iterator::operator-=
Decrements a specified offset from a checked_iterator.
checked_iterator<_Cont, _Iter>& operator-=(
difference_type _Off
);
Parameters
- _Off
The offset by which to increment the iterator.
Return Value
A reference to the element addressed by the checked_iterator.
Remarks
For more information, see Checked Iterators.
Example
// checked_iterators_op_minus_eq.cpp
// compile with: /EHsc
#include <vector>
#include <iostream>
int main() {
using namespace std;
vector<int> V1;
for (int i = 0; i < 10 ; i++)
V1.push_back(i);
stdext::checked_iterator< vector<int> > VChkIter(V1, V1.end());
VChkIter -= 1;
cout << *VChkIter << endl;
VChkIter -= 4;
cout << *VChkIter << endl;
}
9
5
Requirements
Header: <iterator>
Namespace: stdext