hash_multiset::begin
[!POZNÁMKA]
Toto rozhraní API je zastaralé.Alternativou je unordered_multiset – třída.
Vrátí iterace, který řeší první prvek hash_multiset.
const_iterator begin( ) const;
iterator begin( );
Vrácená hodnota
Obousměrný iterátor, který první prvek hash_multiset nebo umístění následných prázdné hash_multiset adresování.
Poznámky
Pokud vrácená hodnota začít je přiřazen const_iterator, prvků v hash_multiset objektu nelze změnit.Pokud vrácená hodnota začít je přiřazen iterátor, mohou být upraveny prvky v objektu hash_multiset.
V aplikaci Visual C++ .NET 2003, členové hlavičkových souborů tříd <hash_map> a <hash_set> již nejsou v oboru názvů std, ale byly přesunuty do oboru názvů stdext.Další informace naleznete v tématu Obor názvů stdext.
Příklad
// hash_multiset_begin.cpp
// compile with: /EHsc
#include <hash_set>
#include <iostream>
int main( )
{
using namespace std;
using namespace stdext;
hash_multiset <int> hms1;
hash_multiset <int>::iterator hms1_Iter;
hash_multiset <int>::const_iterator hms1_cIter;
hms1.insert( 1 );
hms1.insert( 2 );
hms1.insert( 3 );
hms1_Iter = hms1.begin( );
cout << "The first element of hms1 is " << *hms1_Iter << endl;
hms1_Iter = hms1.begin( );
hms1.erase( hms1_Iter );
// The following 2 lines would err because the iterator is const
// hms1_cIter = hms1.begin( );
// hms1.erase( hms1_cIter );
hms1_cIter = hms1.begin( );
cout << "The first element of hms1 is now " << *hms1_cIter << endl;
}
Požadavky
Záhlaví:<hash_set>
Obor názvů: stdext