Compartilhar via


array::crbegin

Retorna um iterador const para o primeiro elemento em uma matriz invertida.

const_reverse_iterator crbegin( ) const;

Valor de retorno

Um iterador de acesso aleatório do inverso const que trata o primeiro elemento em uma matriz invertida ou que trata o que fosse o último elemento na matriz unreversed.

Comentários

Com o valor de retorno de crbegin, o objeto de matriz não pode ser alterado.

Exemplo

// array_crbegin.cpp
// compile with: /EHsc
#include <array>
#include <iostream>

int main( )
{
   using namespace std;   
   array<int, 2> v1 = {1, 2};
   array<int, 2>::iterator v1_Iter;
   array<int, 2>::const_reverse_iterator v1_rIter;
   
   v1_Iter = v1.begin( );
   cout << "The first element of array is "
        << *v1_Iter << "." << endl;

   v1_rIter = v1.crbegin( );
   cout << "The first element of the reversed array is "
        << *v1_rIter << "." << endl;
}
  
  

Requisitos

Cabeçalho: <array>

namespace: STD

Consulte também

Referência

<array>

array Class (TR1)

Standard Template Library