checked_iterator::operator+=

Adds a specified offset to 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_plus_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.begin());

   cout << *VChkIter << endl;
   VChkIter += 4;
   cout << *VChkIter << endl;
}

0
4

Requirements

Header: <iterator>

Namespace: stdext

See Also

Reference

checked_iterator Class

Standard Template Library

Other Resources

checked_iterator Members