hash_set::reference
[!POZNÁMKA]
Toto rozhraní API je zastaralé.Alternativou je unordered_set Class.
Typ, který poskytuje odkaz na prvek uložené v hash_set.
typedef list<typename Traits::value_type, typename Traits::allocator_type>::reference reference;
Poznámky
V aplikaci Visual C++ .NET 2003, členové <hash_map> a <hash_set> jsou již v oboru názvů std soubory hlaviček, ale spíše být přesunut do oboru názvů stdext.Viz stdext obor názvů Další informace.
Příklad
// hash_set_reference.cpp
// compile with: /EHsc
#include <hash_set>
#include <iostream>
int main( )
{
using namespace std;
using namespace stdext;
hash_set <int> hs1;
hs1.insert( 10 );
hs1.insert( 20 );
// Declare and initialize a reference &Ref1 to the 1st element
int &Ref1 = *hs1.begin( );
cout << "The first element in the hash_set is "
<< Ref1 << "." << endl;
// The value of the 1st element of the hash_set can be changed
// by operating on its (non-const) reference
Ref1 = Ref1 + 5;
cout << "The first element in the hash_set is now "
<< *hs1.begin() << "." << endl;
}
Požadavky
Záhlaví: <hash_set>
Obor názvů: stdext