hash_multimap::rend
[!NOT]
Bu API artık kullanılmıyor.Alternatif unordered_multimap Class.
Tersine çevrilmiş hash_multimap'deki son öğe izleyen konum adresleri bir yineleyici döndürür.
const_reverse_iterator rend( ) const;
reverse_iterator rend( );
Dönüş Değeri
Tersine çevrilmiş bir hash_multimap (unreversed hash_multimap ilk öğenin önünde konumu)'deki son öğe izleyen konum adresleri ters çift yönlü Yineleyici.
Notlar
rendtersine çevrilmiş bir hash_multimap ile kullanılan gibi Son bir hash_multimap ile birlikte kullanılır.
Dönüş değerini rend için atanmış bir const_reverse_iterator, sonra da hash_multimap nesnesi değiştirilemez.Dönüş değerini rend atanmış bir reverse_iterator, sonra hash_multimap nesne değiştirilebilir.
rendters bir yineleyici olup, hash_multimap sonuna ulaştı için test etmek için kullanılabilir.
Tarafından döndürülen değeri rend 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_rend.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> :: reverse_iterator hm1_rIter;
hash_multimap <int, int> :: const_reverse_iterator hm1_crIter;
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_rIter = hm1.rend( );
hm1_rIter--;
cout << "The last element of the reversed hash_multimap hm1 is "
<< hm1_rIter -> first << "." << endl;
// begin can be used to start an iteration
// through a hash_multimap in a forward order
cout << "The hash_multimap is: ";
for ( hm1_Iter = hm1.begin( ) ; hm1_Iter != hm1.end( ); hm1_Iter++)
cout << hm1_Iter -> first << " ";
cout << "." << endl;
// rbegin can be used to start an iteration
// through a hash_multimap in a reverse order
cout << "The reversed hash_multimap is: ";
for ( hm1_rIter = hm1.rbegin( ) ; hm1_rIter != hm1.rend( ); hm1_rIter++)
cout << hm1_rIter -> first << " ";
cout << "." << endl;
// A hash_multimap element can be erased by dereferencing its key
hm1_rIter = --hm1.rend( );
hm1.erase ( hm1_rIter -> first );
hm1_rIter = hm1.rend( );
hm1_rIter--;
cout << "After the erasure, the last element "
<< "in the reversed hash_multimap is "
<< hm1_rIter -> first << "." << endl;
}
Gereksinimler
Başlık: <hash_map>
Ad alanı: stdext