hash_set::empty
![]() |
---|
Этот API устарел.Альтернативы unordered_set Class. |
Тесты, если hash_set пустым.
bool empty( ) const;
Возвращаемое значение
true если hash_set пуст; false если hash_set непустой.
Заметки
В Visual C++ .NET 2003 <hash_map> элементы файлов заголовков и <hash_set> больше не находятся в пространстве имен std, но скорее перейти на пространство имен stdext.Дополнительные сведения см. в разделе Пространство имен stdext.
Пример
// 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;
}
Требования
заголовок: <hash_set>
Stdext пространство имен: