hash_set::empty
Hinweis |
---|
Diese API ist veraltet.Die Alternative ist unordered_set Class. |
Prüft, ob ein hash_set leer ist.
bool empty( ) const;
Rückgabewert
true, wenn das hash_set leer ist; false, wenn das hash_set nicht leer ist.
Hinweise
In Visual C++ .NET 2003, sind Member der <hash_map> und <hash_set> Headerdateien nicht mehr im stdnamespace, sondern sind in den stdext Namespace verschoben wurde.Weitere Informationen finden Sie unter Der stdext-Namespace.
Beispiel
// hash_set_empty.cpp
// compile with: /EHsc
#include <hash_set>
#include <iostream>
int main( )
{
using namespace std;
using namespace stdext;
hash_set <int> hs1, hs2;
hs1.insert ( 1 );
if ( hs1.empty( ) )
cout << "The hash_set hs1 is empty." << endl;
else
cout << "The hash_set hs1 is not empty." << endl;
if ( hs2.empty( ) )
cout << "The hash_set hs2 is empty." << endl;
else
cout << "The hash_set hs2 is not empty." << endl;
}
Anforderungen
Header: <hash_set>
Namespace: stdext