다음을 통해 공유


map::cend

Const 끝 과거 반복기를 반환합니다.

const_iterator cend( ) const;

반환 값

최종 이전 반복기입니다.경우는 map Class 다음 비어 map::cend() == map::begin().

설명

cend반복기의 끝이 전달 된 여부를 테스트 하려면 사용 되는 map.

반환 값 cend 역참조 해야 합니다.

예제

// map_cend.cpp
// compile with: /EHsc
#include <map>
#include <iostream>

int main( )
{
   using namespace std;
   map <int, int> m1;

   map <int, int> :: const_iterator m1_cIter;
   typedef pair <int, int> Int_Pair;

   m1.insert ( Int_Pair ( 1, 10 ) );
   m1.insert ( Int_Pair ( 2, 20 ) );
   m1.insert ( Int_Pair ( 3, 30 ) );

   m1_cIter = m1.cend( );
   m1_cIter--;
   cout << "The value of the last element of m1 is:\n" 
        << m1_cIter -> second << endl;
}
  

요구 사항

헤더: <map>

네임 스페이스: std

참고 항목

참조

map Class

표준 템플릿 라이브러리