checked_array_iterator::operator==

测试两个 checked_array_iterator 对象是否相等。

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

参数

  • _Right
    checked_array_iterator 检查的相等性。

备注

有关详细信息,请参阅经过检查的迭代器

示例

// checked_array_iterators_opeq.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 equal" << endl;
   else
      cout << "checked_array_iterators are not equal" << endl;

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

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

要求

头文件: <iterator>

**命名空间:**stdext

请参见

参考

checked_array_iterator 类

标准模板库