list::cbegin
Listedeki ilk öğe adresleme const bir yineleyici döndürür.
const_iterator cbegin( ) const;
Dönüş Değeri
İlk öğe adresleme const bir çift yönlü Yineleyici list Class veya izleyen boş yere list.
Notlar
Dönüş değeri ile cbegin, öğeleri list nesnesi değiştirilemez.
Örnek
// list_cbegin.cpp
// compile with: /EHsc
#include <list>
#include <iostream>
int main( )
{
using namespace std;
list <int> c1;
list <int>::const_iterator c1_cIter;
c1.push_back( 1 );
c1.push_back( 2 );
c1_cIter = c1.cbegin( );
cout << "The first element of c1 is " << *c1_cIter << endl;
}
Çıktı
The first element of c1 is 1
Gereksinimler
Başlık: <list>
Namespace: std