Partager via


checked_array_iterator::operator!=

Tests two checked_array_iterators for inequality.

bool operator!=(
   const checked_array_iterator<_Iterator>& _Right
) const;

Parameters

  • _Right
    The checked_array_iterator against which to check for inequality.

Remarks

For more information, see Checked Iterators.

Example

// checked_array_iterators_opneq.cpp
// compile with: /EHsc
#include <iterator>
#include <iostream> 

using namespace std;
using namespace stdext;

int main() {
   int a[] = {0, 1, 2, 3, 4};
   int b[5];
   copy(a, a + 5, checked_array_iterator<int*>(b,5));
   copy(a, a + 5, checked_array_iterator<int*>(b,5));

   checked_array_iterator<int*> checked_output_iterator(b,5);
   checked_array_iterator<int*> checked_output_iterator2(b,5);

   if (checked_output_iterator2 != checked_output_iterator)
      cout << "checked_array_iterators are not equal" << endl;
   else
      cout << "checked_array_iterators are equal" << endl;

   copy (a, a + 5, checked_output_iterator);
   checked_output_iterator++;

   if (checked_output_iterator2 != checked_output_iterator)
      cout << "checked_array_iterators are not equal" << endl;
   else
      cout << "checked_array_iterators are equal" << endl;
}
checked_array_iterators are equal
checked_array_iterators are not equal

Requirements

Header: <iterator>

Namespace: stdext

See Also

Reference

checked_array_iterator Class

Standard Template Library

Other Resources

checked_array_iterator Members