Udostępnij za pośrednictwem


vector::cend

Zwraca iteratora przeszłości końcowy.

const_iterator cend( ) const;

Wartość zwracana

Const iteratora przeszłości końcowy dla vector Class.If the vector is empty, vector::cend() == vector::cbegin().

Uwagi

Zwracana wartość cend (odpowiednio zmniejszany), vector obiektu nie można modyfikować.

Przykład

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

   for ( v1_Iter = v1.cbegin( ) ; v1_Iter != v1.cend( ) ; v1_Iter++ )
      cout << *v1_Iter << endl;
}
  

Wymagania

Nagłówek: <vector>

Obszar nazw: std

Zobacz też

Informacje

vector Class

Standardowa biblioteka szablonu