逆順の配列内の最初の要素への定数反復子を返します。
const_reverse_iterator crbegin( ) const;
戻り値
逆順の配列内の最初の要素または通常の順序の配列内の最後の要素だったものを指す定数逆順ランダム アクセス反復子。
解説
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