다음을 통해 공유


vector::end

마지막 바로 다음 반복기를 반환합니다.

iterator end( );  const_iterator end( ) const;

반환 값

벡터의 마지막 바로 다음 반복기입니다. 벡터가 비어 있으면 vector::end() == vector::begin()입니다.

예제

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

요구 사항

헤더: <vector>

네임스페이스: std

참고 항목

참조

vector 클래스

표준 템플릿 라이브러리