Delen via


checked_iterator::operator+

Adds an offset to an iterator and returns the new checked_iterator addressing the inserted element at the new offset position.

checked_iterator<_Cont, _Iter> operator+(
   difference_type _Off
) const;

Parameters

  • _Off
    The offset to be added to the checked_iterator.

Return Value

A checked_iterator addressing the offset element.

Remarks

For more information, see Checked Iterators.

Example

// checked_iterators_op_plus.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 = VChkIter + 5;
   cout << *VChkIter << endl;
}

0 5

Requirements

Header: <iterator>

Namespace: stdext

See Also

Reference

checked_iterator Class

Standard Template Library

Other Resources

checked_iterator Members