multimap::crend
Returns a const iterator that addresses the location succeeding the last element in a reversed multimap.
const_reverse_iterator crend( ) const;
반환 값
A const reverse bidirectional iterator that addresses the location succeeding the last element in a reversed multimap 클래스 (the location that had preceded the first element in the unreversed multimap).
설명
crend is used with a reversed multimap just as multimap::end is used with a multimap.
With the return value of crend, the multimap object cannot be modified.
crend can be used to test to whether a reverse iterator has reached the end of its multimap.
이 crend 로 반환된 값은 역참조 되지 않아야 합니다.
예제
// multimap_crend.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.crend( );
m1_crIter--;
cout << "The last element of the reversed multimap m1 is "
<< m1_crIter -> first << "." << endl;
}
요구 사항
헤더: <맵>
네임스페이스: std