Aracılığıyla paylaş


hash_set::begin

Not

Bu API artık kullanılmıyor.Alternatif unordered_set Class.

Hash_set ilk öğe gideren bir yineleyici döndürür.

const_iterator begin( ) const; 
iterator begin( );

Dönüş Değeri

İlk öğe hash_set veya boş bir hash_set izleyen konum adresleme çift yönlü Yineleyici.

Notlar

Dönüş değerini başlayan için atanan bir const_iterator, hash_set nesnesi içindeki öğeler değiştirilemez. Dönüş değerini başlamak atanmış bir Yineleyici, hash_set nesnesi içindeki öğeleri değiştirilebilir.

Visual C++ .NET 2003, üyeleri de <hash_map> ve <hash_set> başlık dosyaları artık std ad alanında bulunan, ancak bunun yerine stdext ad alanına taşınmış. Bkz: ad stdext daha fazla bilgi için.

Örnek

// hash_set_begin.cpp
// compile with: /EHsc
#include <hash_set>
#include <iostream>

int main( )
{
   using namespace std;
   using namespace stdext;
   hash_set <int> hs1;
   hash_set <int>::iterator hs1_Iter;
   hash_set <int>::const_iterator hs1_cIter;
   
   hs1.insert( 1 );
   hs1.insert( 2 );
   hs1.insert( 3 );

   hs1_Iter = hs1.begin( );
   cout << "The first element of hs1 is " << *hs1_Iter << endl;

   hs1_Iter = hs1.begin( );
   hs1.erase( hs1_Iter );

   // The following 2 lines would err because the iterator is const
   // hs1_cIter = hs1.begin( );
   // hs1.erase( hs1_cIter );

   hs1_cIter = hs1.begin( );
   cout << "The first element of hs1 is now " << *hs1_cIter << endl;
}
  

Gereksinimler

Başlık: <hash_set>

Ad alanı: stdext

Ayrıca bkz.

Başvuru

hash_set Class

Standart Şablon Kütüphanesi