共用方式為


checked_iterator::operator<

Tests if the checked_iterator on the left side of the operator is less than the checked_iterator on the right side.

template <class Iter2>
    bool operator<(
        const checked_iterator<Container, Iter2>& _Right) const;

Parameters

  • _Right
    The checked_iterator against which to check for inequality.

Remarks

For more information, see Checked Iterators.

Example

// checked_iterators_oplt.cpp
// compile with: /EHsc
#include <vector>
#include <iostream>

int main() {
   using namespace std;   
   vector<int> V1( 10 );
   stdext::checked_iterator< vector<int> > VChkIter1(V1, V1.begin());
   stdext::checked_iterator< vector<int> > VChkIter2(V1, V1.begin());

   VChkIter1++;
   VChkIter2++;

   if (VChkIter1 < VChkIter2)
      cout << "VChkIter1 is less than VChkIter2" << endl;
   else
      cout << "VChkIter1 is not less than VChkIter2" << endl;

   VChkIter2++;

   if (VChkIter1 < VChkIter2)
      cout << "VChkIter1 is less than VChkIter2" << endl;
   else
      cout << "VChkIter1 is not less than VChkIter2" << endl;
}

VChkIter1 is not less than VChkIter2
VChkIter1 is less than VChkIter2

Requirements

Header: <iterator>

Namespace: stdext

See Also

Concepts

checked_iterator Class

checked_iterator Members

Standard Template Library