Aracılığıyla paylaş


hash_multimap::end

[!NOT]

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

İzleyen bir hash_multimap'deki son öğe konumu gideren bir yineleyici döndürür.

const_iterator end( ) const; 
iterator end( );

Dönüş Değeri

İzleyen bir hash_multimap'deki son öğe konumu ele çift yönlü Yineleyici.Hash_multimap boş, hash_multimap::end ise hash_multimap::begin ==.

Notlar

Son bir yineleyici, hash_multimap sonuna ulaştı olup olmadığını sınamak için kullanılır.

Tarafından döndürülen değeri Son değil veta.

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_end.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 ( 1, 10 ) );
   hm1.insert ( Int_Pair ( 2, 20 ) );
   hm1.insert ( Int_Pair ( 3, 30 ) );

   hm1_cIter = hm1.end( );
   hm1_cIter--;
   cout << "The value of last element of hm1 is " 
        << hm1_cIter -> second << "." << endl;
   
   hm1_Iter = hm1.end( );
   hm1_Iter--;
   hm1.erase ( hm1_Iter );

   // The following 2 lines would err because the iterator is const
   // hm1_cIter = hm1.end ( );
   // hm1_cIter--;
   // hm1.erase ( hm1_cIter );

   hm1_cIter = hm1.end( );
   hm1_cIter--;
   cout << "The value of last element of hm1 is now "
        << hm1_cIter -> second << "." << endl;
}
  
  

Gereksinimler

Başlık: <hash_map>

Ad alanı: stdext

Ayrıca bkz.

Başvuru

hash_multimap Class

Standart Şablon Kütüphanesi