Поделиться через


hash_multimap::empty

ПримечаниеПримечание

Этот API устарел.Альтернативы unordered_multimap Class.

Тесты, если hash_multimap пустым.

bool empty( ) const;

Возвращаемое значение

true если hash_multimap пуст; false если hash_multimap непустой.

Заметки

В Visual C++ .NET 2003 <hash_map> элементы файлов заголовков и <hash_set> больше не находятся в пространстве имен std, но скорее перейти на пространство имен stdext.Дополнительные сведения см. в разделе Пространство имен stdext.

Пример

// hash_multimap_empty.cpp
// compile with: /EHsc
#include <hash_map>
#include <iostream>

int main( )
{
   using namespace std;
   using namespace stdext;
   hash_multimap <int, int> hm1, hm2;

   typedef pair <int, int> Int_Pair;
   hm1.insert ( Int_Pair ( 1, 1 ) );

   if ( hm1.empty( ) )
      cout << "The hash_multimap hm1 is empty." << endl;
   else
      cout << "The hash_multimap hm1 is not empty." << endl;

   if ( hm2.empty( ) )
      cout << "The hash_multimap hm2 is empty." << endl;
   else
      cout << "The hash_multimap hm2 is not empty." << endl;
}
  
  

Требования

заголовок: <hash_map>

Stdext пространство имен:

См. также

Ссылки

hash_multimap Class

Стандартная библиотека шаблонов