list::crend
Tersine çevrilmiş bir liste içindeki son öğe izleyen konumuna gideren const bir yineleyici döndürür.
const_reverse_iterator rend( ) const;
Dönüş Değeri
Bir const izleyen son öğe tersine çevrilmiş bir konum adresleri çift yönlü Yineleyici ters list Class (ilk öğe unreversed önünde konumu list).
Notlar
crendtersine çevrilmiş bir listesiyle kullanılır gibi list::end ile kullanılan bir list.
Dönüş değeri ile crend, list nesnesi değiştirilemez.
crendters bir yineleyici mi sonuna kadar ulaştığı için test etmek için kullanılan, list.
Tarafından döndürülen değeri crend başvuru değil yapıldı.
Örnek
// list_crend.cpp
// compile with: /EHsc
#include <list>
#include <iostream>
int main( )
{
using namespace std;
list <int> c1;
list <int>::const_reverse_iterator c1_crIter;
c1.push_back( 10 );
c1.push_back( 20 );
c1.push_back( 30 );
c1_crIter = c1.crend( );
c1_crIter --; // Decrementing a reverse iterator moves it forward in
// the list (to point to the first element here)
cout << "The first element in the list is: " << *c1_crIter << endl;
}
Gereksinimler
Başlık: <list>
Namespace: std