다음을 통해 공유


multimap::crbegin

Returns a const iterator addressing the first element in a reversed multimap.

const_reverse_iterator crbegin( ) const;

반환 값

A const reverse bidirectional iterator addressing the first element in a reversed multimap 클래스 or addressing what had been the last element in the unreversed multimap.

설명

crbegin is used with a reversed multimap just as begin is used with a multimap.

With the return value of crbegin, the multimap object cannot be modified.

crbegin can be used to iterate through a multimap backwards.

예제

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

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

   multimap <int, int> :: const_reverse_iterator m1_crIter;
   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_crIter = m1.crbegin( );
   cout << "The first element of the reversed multimap m1 is "
        << m1_crIter -> first << "." << endl;
}
  

요구 사항

헤더: <맵>

네임스페이스: std

참고 항목

참조

multimap 클래스

표준 템플릿 라이브러리