다음을 통해 공유


operator== (multimap)

Multimap 개체 연산자의 왼쪽에서 오른쪽 multimap 개체 인지 테스트 합니다.

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

매개 변수

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

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

반환 값

true 이면 multimap 연산자의 왼쪽에 multimap; 연산자의 오른쪽에와 같은 경우 그렇지 않으면 거짓.

설명

Multimap 개체 비교 pairwise 요소 비교를 기반으로 합니다.두 multimaps는 같은 수의 요소 들 각각의 요소 값이 같은 경우 같습니다.그렇지 않으면 두 개체는 서로 다른 개체입니다.

예제

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

int main( )
{
   using namespace std;
   multimap<int, int> m1, m2, m3;
   int i;
   typedef pair<int, int> Int_Pair;

   for (i = 0; i < 3; i++)
   {
      m1.insert(Int_Pair(i, i));
      m2.insert(Int_Pair(i, i*i));
      m3.insert(Int_Pair(i, i));
   }

   if ( m1 == m2 )
      cout << "m1 and m2 are equal" << endl;
   else
      cout << "m1 and m2 are not equal" << endl;

   if ( m1 == m3 )
      cout << "m1 and m3 are equal" << endl;
   else
      cout << "m1 and m3 are not equal" << endl;
}
  

요구 사항

헤더: <map>

네임 스페이스: std

참고 항목

참조

표준 템플릿 라이브러리