Sdílet prostřednictvím


checked_array_iterator::checked_array_iterator

Vytvoří výchozí checked_array_iterator nebo checked_array _iterator z podkladové iterace.

checked_array_iterator( );
checked_array_iterator(
   ITerator ptr,
   size_t size,
   size_t index = 0
);

Parametry

  • ptr
    Ukazatel na pole.

  • size
    Velikost pole.

  • index
    (Volitelné) Prvek v poli Inicializace iteraci. Ve výchozím nastavení iteraci smyčky první prvek pole.

Poznámky

Další informace naleznete v tématu Checked – iterátory.

Příklad

// checked_array_iterators_ctor.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));

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

   checked_array_iterator<int*> checked_output_iterator(b,5);
   copy (a, a + 5, checked_output_iterator);
   for (int i = 0 ; i < 5 ; i++)
      cout << b[i] << " ";
   cout << endl;

   checked_array_iterator<int*> checked_output_iterator2(b,5,3);
   cout << *checked_output_iterator2 << endl;
}
  

Požadavky

Hlavička: <iterátor>

Obor názvů: stdext

Viz také

Referenční dokumentace

checked_array_iterator – třída

Standardní knihovna šablon