array::crbegin

返回const迭代器到一个反向数组的第一个元素。

const_reverse_iterator crbegin( ) const;

返回值

解决const反转随机访问迭代器解决在一个反向数组的第一个元素以及处于unreversed数组的最后一个元素。

备注

crbegin的返回值,就不能修改数组对象。

示例

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

要求

标头: <array>

命名空间: std

请参见

参考

<array>

array Class (TR1)

标准模板库