다음을 통해 공유


vector::cend

최종 이전 반복기를 반환합니다.

const_iterator cend( ) const;

반환 값

Const 끝 이전 반복기는 vector Class.If the vector is empty, vector::cend() == vector::cbegin().

설명

반환 값의 cend (적절 한 감소)는 vector 개체를 수정할 수 없습니다.

예제

// 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;
}
  

요구 사항

헤더: <vector>

네임 스페이스: std

참고 항목

참조

vector Class

표준 템플릿 라이브러리