operator!= (set)
Sınamaları işlecinin sol tarafındaki set nesne kümesi nesnesini sağ tarafta eşit değildir.
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 yoksa kümeleri eşit; yanlış eşitse ayarlar.
Notlar
Küme nesneleri arasında karşılaştırma öğelerini ikili karşılaştırmasını dayanı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_ne.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 not equal." << endl;
else
cout << "The sets s1 and s2 are equal." << endl;
if ( s1 != s3 )
cout << "The sets s1 and s3 are not equal." << endl;
else
cout << "The sets s1 and s3 are equal." << endl;
}
Gereksinimler
Başlık: <set>
Namespace: std