checked_array_iterator::operator-=

递减从 checked_array_iterator中指定的偏移量。

checked_array_iterator<_Iterator>& operator-=(
   difference_type _Off
);

参数

  • _Off
    通过前面添加迭代器的偏移量。

返回值

checked_array_iterator解决的元素的引用。

备注

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

示例

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

int main() {
   using namespace stdext;
   using namespace std;
   int a[] = {6, 3, 77, 199, 222};
   int b[5];
   copy(a, a + 5, checked_array_iterator<int*>(b,5));

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

   checked_output_iterator += 3;
   cout << *checked_output_iterator << endl;
   checked_output_iterator -= 2;
   cout << *checked_output_iterator << endl;
}
  

要求

头文件: <iterator>

**命名空间:**stdext

请参见

参考

checked_array_iterator 类

标准模板库