共用方式為


checked_iterator::pointer

A type that provides a pointer to an element addressed by a checked_iterator.

typedef typename iterator_traits<_Iter>::pointer pointer;

Remarks

For more information, see Checked Iterators.

Example

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

int main() {
   using namespace std;

   typedef vector<pair<int,int> > pVector;
   pVector vec;
   vec.push_back( pVector::value_type( 1,2 ) );
   vec.push_back( pVector::value_type( 3,4 ) );
   vec.push_back( pVector::value_type( 5,6 ) );

   stdext::checked_iterator<pVector > pvIter(vec, vec.begin ( ));
   stdext::checked_iterator<pVector >::pointer p = &(*pvIter);
      
   cout << "The first pair is:\n" << "(" << p -> first << ", " 
        << p -> second << ")" << endl;
}

The first pair is:
(1, 2)

Requirements

Header: <iterator>

Namespace: stdext

See Also

Concepts

checked_iterator Class

checked_iterator Members

Standard Template Library