hash_multimap::begin
[!NOT]
Bu API artık kullanılmıyor.Alternatif unordered_multimap Class.
Hash_multimap ilk öğe adresleme bir yineleyici döndürür.
const_iterator begin( ) const;
iterator begin( );
Dönüş Değeri
İlk öğe hash_multimap veya boş bir hash_multimap izleyen konum adresleme çift yönlü Yineleyici.
Notlar
Dönüş değerini başlayan için atanan bir const_iterator, hash_multimap nesnesi içindeki öğeler değiştirilemez.Dönüş değerini başlamak atanmış bir Yineleyici, hash_multimap 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_multimap_begin.cpp
// compile with: /EHsc
#include <hash_map>
#include <iostream>
int main( )
{
using namespace std;
using namespace stdext;
hash_multimap <int, int> hm1;
hash_multimap <int, int> :: iterator hm1_Iter;
hash_multimap <int, int> :: const_iterator hm1_cIter;
typedef pair <int, int> Int_Pair;
hm1.insert ( Int_Pair ( 0, 0 ) );
hm1.insert ( Int_Pair ( 1, 1 ) );
hm1.insert ( Int_Pair ( 2, 4 ) );
hm1_cIter = hm1.begin ( );
cout << "The first element of hm1 is " << hm1_cIter -> first
<< "." << endl;
hm1_Iter = hm1.begin ( );
hm1.erase ( hm1_Iter );
// The following 2 lines would err because the iterator is const
// hm1_cIter = hm1.begin ( );
// hm1.erase ( hm1_cIter );
hm1_cIter = hm1.begin( );
cout << "The first element of hm1 is now " << hm1_cIter -> first
<< "." << endl;
}
Gereksinimler
Başlık: <hash_map>
Ad alanı: stdext