hash_set::reference
Примечание
Этот API устарел.Альтернативой является Класс unordered_set.
Тип, который предоставляет ссылку на элемент хранящихся в hash_set.
typedef list<typename Traits::value_type, typename Traits::allocator_type>::reference reference;
Заметки
В Visual C++ .NET 2003 C, элементы файла заголовка <hash_map> и <hash_set> больше не в пространстве имен std, а перемещается в пространство имен stdext. Дополнительные сведения см. в разделе Пространство имен stdext.
Пример
// 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;
}
Требования
Заголовок:<hash_set>
Пространство имен: stdext