checked_array_iterator::operator+
向迭代器的偏移量并返回新 checked_array_iterator 解决该插入的元素在新的偏移位置。
checked_array_iterator<_Iterator> operator+(
difference_type _Off
) const;
参数
- _Off
要添加的偏移量 checked_array_iterator。
返回值
解决的 checked_array_iterator 扭曲元素。
备注
有关更多信息,请参见 经过检查的迭代器。
示例
// checked_array_iterators_op_plus.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);
cout << *checked_output_iterator << endl;
checked_output_iterator = checked_output_iterator + 3;
cout << *checked_output_iterator << endl;
}
要求
标头: <iterator>
命名空间: stdext