다음을 통해 공유


operator!= (multiset)

Tests if the multiset object on the left side of the operator is not equal to the multiset object on the right side.

bool operator!=( 
   const multiset <Key, Traits, Allocator>& _Left, 
   const multiset <Key, Traits, Allocator>& _Right 
);

매개 변수

  • _Left
    multiset 형식의 개체입니다.

  • _Right
    multiset 형식의 개체입니다.

반환 값

true if the sets or multisets are not equal; false if sets or multisets are equal.

설명

The comparison between multiset objects is based on a pairwise comparison between their elements. Two sets or multisets are equal if they have the same number of elements and their respective elements have the same values. 그렇지 않으면 두 개체는 서로 다른 개체입니다.

예제

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

int main( )
{
   using namespace std;
   multiset <int> s1, s2, s3;
   int i;

   for ( i = 0 ; i < 3 ; i++ )
   {
      s1.insert ( i );
      s2.insert ( i * i );
      s3.insert ( i );
   }

   if ( s1 != s2 )
      cout << "The multisets s1 and s2 are not equal." << endl;
   else
      cout << "The multisets s1 and s2 are equal." << endl;

   if ( s1 != s3 )
      cout << "The multisets s1 and s3 are not equal." << endl;
   else
      cout << "The multisets s1 and s3 are equal." << endl;
}
  

요구 사항

헤더: <설정>

네임스페이스: std

참고 항목

참조

표준 템플릿 라이브러리