다음을 통해 공유


multimap::empty

Tests if a multimap is empty.

bool empty( ) const;

반환 값

true if the multimap is empty; false if the multimap is nonempty.

예제

// multimap_empty.cpp
// compile with: /EHsc
#include <map>
#include <iostream>

int main( )
{
   using namespace std;
   multimap <int, int> m1, m2;

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

   if ( m1.empty( ) )
      cout << "The multimap m1 is empty." << endl;
   else
      cout << "The multimap m1 is not empty." << endl;

   if ( m2.empty( ) )
      cout << "The multimap m2 is empty." << endl;
   else
      cout << "The multimap m2 is not empty." << endl;
}
  

요구 사항

헤더: <맵>

네임스페이스: std

참고 항목

참조

multimap 클래스

표준 템플릿 라이브러리