Aracılığıyla paylaş


operator== (set)

Sağ tarafta set nesne kümesi nesnesi işlecinin sol tarafındaki eşitse sınar.

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

Parametreler

  • _Left
    Bir nesne türü set.

  • _Right
    Bir nesne türü set.

Dönüş Değeri

gerçek ; işlecinin sağ tarafındaki set set işlecinin sol tarafındaki eşitse Aksi halde yanlış.

Notlar

Küme nesneleri arasında karşılaştırma öðelerinin yapılandırdı Karşılaştırmasında esas alır. Bunlar aynı sayıda öğe varsa ve bunların ilgili öğeleri aynı değerlere sahip iki eşit. Aksi halde, bunlar eşit olmayan.

Örnek

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

int main( )
{
   using namespace std;
   set <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 sets s1 and s2 are equal." << endl;
   else
      cout << "The sets s1 and s2 are not equal." << endl;

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

Gereksinimler

Başlık: <set>

Namespace: std

Ayrıca bkz.

Başvuru

Standart Şablon Kütüphanesi