다음을 통해 공유


multiset::empty

Tests if a multiset is empty.

bool empty( ) const;

반환 값

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

예제

// multiset_empty.cpp
// compile with: /EHsc
#include <set>
#include <iostream>

int main( )
{
   using namespace std;
   multiset <int> ms1, ms2;
   ms1.insert ( 1 );

   if ( ms1.empty( ) )
      cout << "The multiset ms1 is empty." << endl;
   else
      cout << "The multiset ms1 is not empty." << endl;

   if ( ms2.empty( ) )
      cout << "The multiset ms2 is empty." << endl;
   else
      cout << "The multiset ms2 is not empty." << endl;
}
  

요구 사항

헤더: <설정>

네임스페이스: std

참고 항목

참조

multiset 클래스

표준 템플릿 라이브러리