checked_iterator::operator--
Decrements the checked_iterator to the previous element.
checked_iterator<_Cont, _Iter>& operator--( );
checked_iterator<_Cont, _Iter> operator--( int );
Return Value
The first operator returns the predecremented checked_iterator and the second, the postdecrement operator, returns a copy of the decremented checked_iterator.
Remarks
For more information, see Checked Iterators.
Example
// checked_iterators_op_minus_minus.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--;
cout << *VChkIter << endl;
VChkIter--;
cout << *VChkIter << endl;
}
9
8
Requirements
Header: <iterator>
Namespace: stdext