Condividi tramite


map::crbegin

Restituisce un iteratore const destinato al primo elemento di un mapping inverso.

const_reverse_iterator crbegin( ) const;

Valore restituito

Un iteratore bidirezionale di inversione const destinato al primo elemento in map Class invertito o destinato a ciò che era stato ultimo elemento in mapunreversed.

Note

crbegin viene utilizzato con map invertito come map::begin viene utilizzato con map.

Tramite il valore restituito crbegin, l'oggetto map non può essere modificato

crbegin può essere utilizzato per scorrere map indietro.

Esempio

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

Requisiti

intestazione: <map>

Spazio dei nomi: deviazione standard

Vedere anche

Riferimenti

map Class

Libreria di modelli standard