共用方式為


array::crend

傳回處理成功最後一個項目的位置會反轉陣列的 const Iterator。

const_reverse_iterator crend( ) const;

傳回值

解決成功最後一個項目的位置會反轉陣列的常數反向隨機存取 Iterator (在這個 unreversed 陣列的第一個項目之前) 的位置。

備註

無效 array::cend 以陣列,crend 使用已還原的陣列。

crend 的傳回值 (最好是將遞減),無法修改陣列物件。

crend 可用來測試反向 Iterator 是否已到達其陣列的結尾。

不應該取值 crend 傳回的值。

範例

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

int main( )
{
   using namespace std;   
   array<int, 2> v1 = {1, 2};
   array<int, 2>::const_reverse_iterator v1_rIter;
   
   for ( v1_rIter = v1.rbegin( ) ; v1_rIter != v1.rend( ) ; v1_rIter++ )
      cout << *v1_rIter << endl;
}
  

需求

標題: <array>

命名空間: std

請參閱

參考

<array>

array Class (TR1)

標準樣板程式庫