Udostępnij za pośrednictwem


map::crbegin

Zwraca wartość sterująca const, adresowania pierwszego elementu na mapie odwrócone.

const_reverse_iterator crbegin( ) const;

Wartość zwracana

Const odwrócić sterująca dwukierunkowy adresowania pierwszym elementem odwrócone map — Klasa lub adresowania, co było ostatniego elementu w stałe map.

Uwagi

crbeginjest używana z odwróconą map po prostu jako map::begin jest używana z map.

Z zwraca wartość z crbegin, map nie można modyfikować obiektów

crbeginmożna wykonać iterację map do tyłu.

Przykład

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

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

   map <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 map m1 is "
        << m1_crIter -> first << "." << endl;
}
  

Wymagania

Nagłówek: <map>

Przestrzeń nazw: std

Zobacz też

Informacje

map — Klasa

Standardowa biblioteka szablonów