Udostępnij za pośrednictwem


vector::end

Zwraca iterator poza końcem.

iterator end( );  const_iterator end( ) const;

Wartość zwracana

Sterująca przeszłości end wektora.Jeśli wektor jest pusta, vector::end() == vector::begin().

Przykład

// vector_end.cpp
// compile with: /EHsc
#include <vector>
#include <iostream>
int main( )
{
   using namespace std;
   vector<int> v1;
   vector<int>::iterator pos;
   
   v1.push_back(1);
   v1.push_back(2);

   for (pos = v1.begin(); pos != v1.end(); ++pos)
      cout << *pos << endl;
}
  

Wymagania

Nagłówek: < wektora >

Przestrzeń nazw: std

Zobacz też

Informacje

vector — Klasa

Standardowa biblioteka szablonów