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;
}
要求
数组页眉: <>
命名空间: std