共用方式為


checked_array_iterator::operator*

傳回這個項目的 checked_array_iterator 位址。

reference operator*( ) const;

傳回值

checked_array_iterator處理的項目的值。

備註

如需詳細資訊,請參閱已檢查的迭代器

範例

// checked_array_iterator_pointer.cpp
// compile with: /EHsc
#include <iterator>
#include <algorithm>
#include <vector>
#include <utility>
#include <iostream>

using namespace std;
using namespace stdext;

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

   for (int i = 0 ; i < 5 ; i++)
      cout << b[i] << endl;

    c[0].first = 10;
    c[0].second = 20;
    
   checked_array_iterator<int*> checked_output_iterator(b,5);
   checked_array_iterator<int*>::pointer p = &(*checked_output_iterator);
   checked_array_iterator<pair<int, int>*> chk_c(c, 1);
   checked_array_iterator<pair<int, int>*>::pointer p_c = &(*chk_c);
   
   cout << "b[0] = " << *p << endl;
   cout << "c[0].first = " << p_c->first << endl;
}
  

需求

標頭:<迭代器>

**命名空間:**stdext

請參閱

參考

checked_array_iterator 類別

標準樣板程式庫