hash_set::size
[!UWAGA]
Ten interfejs API jest nieaktualny.Alternatywą jest unordered_set — Klasa.
Zwraca liczbę elementów w hash_set.
size_type size( ) const;
Wartość zwracana
Bieżąca długość hash_set.
Uwagi
W Visual C++ .NET 2003, elementy członkowskie plików nagłówka <hash_map> i <hash_set> nie są już w przestrzeni nazw std, ale raczej zostały przeniesione do przestrzeni nazw stdext.Zobacz Przestrzeń nazw stdext, aby uzyskać więcej informacji.
Przykład
// hash_set_size.cpp
// compile with: /EHsc
#include <hash_set>
#include <iostream>
int main( )
{
using namespace std;
using namespace stdext;
hash_set <int> hs1;
hash_set <int> :: size_type i;
hs1.insert( 1 );
i = hs1.size( );
cout << "The hash_set length is " << i << "." << endl;
hs1.insert( 2 );
i = hs1.size( );
cout << "The hash_set length is now " << i << "." << endl;
}
Wymagania
Nagłówek: <hash_set>
Przestrzeń nazw: stdext