Poznámka:
Přístup k této stránce vyžaduje autorizaci. Můžete se zkusit přihlásit nebo změnit adresáře.
Přístup k této stránce vyžaduje autorizaci. Můžete zkusit změnit adresáře.
operator!= (set)
Testuje, zda objekt set na levé straně operátoru není roven objektu set na pravé straně.
bool operator!=(const set <Key, Traits, Allocator>& left, const set <Key, Traits, Allocator>& right);
Parametry
Vlevo
Objekt typu set.
Vpravo
Objekt typu set.
Návratová hodnota
true pokud množiny nejsou stejné; false pokud jsou sady stejné.
Poznámky
Porovnání mezi objekty sady je založeno na párovém porovnání mezi jejich prvky. Dvě sady jsou stejné, pokud mají stejný počet prvků a jejich odpovídající prvky mají stejné hodnoty. Jinak jsou nerovné.
Příklad
// 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;
}
/* Output:
The sets s1 and s2 are not equal.
The sets s1 and s3 are equal.
*/
operator< (set)
Testuje, zda objekt set na levé straně operátoru je menší než objekt set na pravé straně.
bool operator<(const set <Key, Traits, Allocator>& left, const set <Key, Traits, Allocator>& right);
Parametry
Vlevo
Objekt typu set.
Vpravo
Objekt typu set.
Návratová hodnota
true je-li sada na levé straně operátoru přísně menší než sada na pravé straně operátoru; jinak false.
Poznámky
Porovnání mezi objekty sady je založeno na párovém porovnání jejich prvků. Vztah menší než mezi dvěma objekty je založen na porovnání prvního páru nerovných prvků.
Příklad
// set_op_lt.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 - 1 );
}
if ( s1 < s2 )
cout << "The set s1 is less than the set s2." << endl;
else
cout << "The set s1 is not less than the set s2." << endl;
if ( s1 < s3 )
cout << "The set s1 is less than the set s3." << endl;
else
cout << "The set s1 is not less than the set s3." << endl;
}
/* Output:
The set s1 is less than the set s2.
The set s1 is not less than the set s3.
*/
operator<= (set)
Testuje, zda objekt set na levé straně operátoru je menší nebo roven objektu set na pravé straně.
bool operator!<=(const set <Key, Traits, Allocator>& left, const set <Key, Traits, Allocator>& right);
Parametry
Vlevo
Objekt typu set.
Vpravo
Objekt typu set.
Návratová hodnota
true je-li nastavená na levé straně operátoru menší nebo rovna sadě na pravé straně operátoru; jinak false.
Poznámky
Porovnání mezi objekty sady je založeno na párovém porovnání jejich prvků. Menší než nebo rovno relaci mezi dvěma objekty je založená na porovnání prvního páru nerovných prvků.
Příklad
// set_op_le.cpp
// compile with: /EHsc
#include <set>
#include <iostream>
int main( )
{
using namespace std;
set <int> s1, s2, s3, s4;
int i;
for ( i = 0 ; i < 3 ; i++ )
{
s1.insert ( i );
s2.insert ( i * i );
s3.insert ( i - 1 );
s4.insert ( i );
}
if ( s1 <= s2 )
cout << "Set s1 is less than or equal to the set s2." << endl;
else
cout << "The set s1 is greater than the set s2." << endl;
if ( s1 <= s3 )
cout << "Set s1 is less than or equal to the set s3." << endl;
else
cout << "The set s1 is greater than the set s3." << endl;
if ( s1 <= s4 )
cout << "Set s1 is less than or equal to the set s4." << endl;
else
cout << "The set s1 is greater than the set s4." << endl;
}
Set s1 is less than or equal to the set s2.
The set s1 is greater than the set s3.
Set s1 is less than or equal to the set s4.
operator== (set)
Testuje, zda je objekt set na levé straně operátoru roven objektu set na pravé straně.
bool operator!==(const set <Key, Traits, Allocator>& left, const set <Key, Traits, Allocator>& right);
Parametry
Vlevo
Objekt typu set.
Vpravo
Objekt typu set.
Návratová hodnota
true je-li sada na levé straně operátoru rovna množině na pravé straně operátoru; jinak false.
Poznámky
Porovnání mezi objekty sady je založeno na párovém porovnání jejich prvků. Dvě sady jsou stejné, pokud mají stejný počet prvků a jejich odpovídající prvky mají stejné hodnoty. Jinak jsou nerovné.
Příklad
// 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;
}
The sets s1 and s2 are not equal.
The sets s1 and s3 are equal.
operator> (set)
Testuje, jestli je objekt set na levé straně operátoru větší než objekt set na pravé straně.
bool operator>(const set <Key, Traits, Allocator>& left, const set <Key, Traits, Allocator>& right);
Parametry
Vlevo
Objekt typu set.
Vpravo
Objekt typu set.
Návratová hodnota
true je-li sada na levé straně operátoru větší než sada na pravé straně operátoru; jinak false.
Poznámky
Porovnání mezi objekty sady je založeno na párovém porovnání jejich prvků. Vztah větší než mezi dvěma objekty je založen na porovnání prvního páru nerovných prvků.
Příklad
// set_op_gt.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 - 1 );
}
if ( s1 > s2 )
cout << "The set s1 is greater than the set s2." << endl;
else
cout << "The set s1 is not greater than the set s2." << endl;
if ( s1 > s3 )
cout << "The set s1 is greater than the set s3." << endl;
else
cout << "The set s1 is not greater than the set s3." << endl;
}
/* Output:
The set s1 is not greater than the set s2.
The set s1 is greater than the set s3.
*/
operator>= (set)
Testuje, zda je objekt set na levé straně operátoru větší nebo roven objektu set na pravé straně.
bool operator!>=(const set <Key, Traits, Allocator>& left, const set <Key, Traits, Allocator>& right);
Parametry
Vlevo
Objekt typu set.
Vpravo
Objekt typu set.
Návratová hodnota
true pokud je nastavená na levé straně operátoru větší nebo rovna sadě na pravé straně seznamu; jinak false.
Poznámky
Porovnání mezi objekty sady je založeno na párovém porovnání jejich prvků. Vztah mezi dvěma objekty je větší než nebo rovno na základě porovnání prvního páru nerovných prvků.
Příklad
// set_op_ge.cpp
// compile with: /EHsc
#include <set>
#include <iostream>
int main( )
{
using namespace std;
set <int> s1, s2, s3, s4;
int i;
for ( i = 0 ; i < 3 ; i++ )
{
s1.insert ( i );
s2.insert ( i * i );
s3.insert ( i - 1 );
s4.insert ( i );
}
if ( s1 >= s2 )
cout << "Set s1 is greater than or equal to set s2." << endl;
else
cout << "The set s1 is less than the set s2." << endl;
if ( s1 >= s3 )
cout << "Set s1 is greater than or equal to set s3." << endl;
else
cout << "The set s1 is less than the set s3." << endl;
if ( s1 >= s4 )
cout << "Set s1 is greater than or equal to set s4." << endl;
else
cout << "The set s1 is less than the set s4." << endl;
}
The set s1 is less than the set s2.
Set s1 is greater than or equal to set s3.
Set s1 is greater than or equal to set s4.
operator!= (multiset)
Testuje, zda objekt s více sadami na levé straně operátoru není roven objektu multiset na pravé straně.
bool operator!=(const multiset <Key, Traits, Allocator>& left, const multiset <Key, Traits, Allocator>& right);
Parametry
Vlevo
Objekt typu multiset.
Vpravo
Objekt typu multiset.
Návratová hodnota
true pokud sady nebo více množin nejsou stejné; false pokud jsou sady nebo více množin stejné.
Poznámky
Porovnání objektů s více sadami je založeno na párovém porovnání mezi jejich prvky. Dvě sady nebo více sad jsou stejné, pokud mají stejný počet prvků a jejich odpovídající prvky mají stejné hodnoty. Jinak jsou nerovné.
Příklad
// 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;
}
The multisets s1 and s2 are not equal.
The multisets s1 and s3 are equal.
operator< (multiset)
Testuje, jestli je objekt s více sadami na levé straně operátoru menší než objekt s více sadami na pravé straně.
bool operator<(const multiset <Key, Traits, Allocator>& left, const multiset <Key, Traits, Allocator>& right);
Parametry
Vlevo
Objekt typu multiset.
Vpravo
Objekt typu multiset.
Návratová hodnota
true je-li multiset na levé straně operátoru přísně menší než multiset na pravé straně operátoru; jinak false.
Poznámky
Porovnání objektů s více sadami je založeno na párovém porovnání jejich prvků. Vztah menší než mezi dvěma objekty je založen na porovnání prvního páru nerovných prvků.
Příklad
// multiset_op_lt.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 - 1 );
}
if ( s1 < s2 )
cout << "The multiset s1 is less than "
<< "the multiset s2." << endl;
else
cout << "The multiset s1 is not less than "
<< "the multiset s2." << endl;
if ( s1 < s3 )
cout << "The multiset s1 is less than "
<< "the multiset s3." << endl;
else
cout << "The multiset s1 is not less than "
<< "the multiset s3." << endl;
}
The multiset s1 is less than the multiset s2.
The multiset s1 is not less than the multiset s3.
operator<= (multiset)
Testuje, jestli je objekt s více sadami na levé straně operátoru menší nebo roven objektu s více sadami na pravé straně.
bool operator!<=(const multiset <Key, Traits, Allocator>& left, const multiset <Key, Traits, Allocator>& right);
Parametry
Vlevo
Objekt typu multiset.
Vpravo
Objekt typu multiset.
Návratová hodnota
true je-li více množina na levé straně operátoru menší nebo rovna více množině na pravé straně operátoru; jinak false.
Poznámky
Porovnání objektů s více sadami je založeno na párovém porovnání jejich prvků. Menší než nebo rovno relaci mezi dvěma objekty je založená na porovnání prvního páru nerovných prvků.
Příklad
// multiset_op_le.cpp
// compile with: /EHsc
#include <set>
#include <iostream>
int main( )
{
using namespace std;
multiset <int> s1, s2, s3, s4;
int i;
for ( i = 0 ; i < 3 ; i++ )
{
s1.insert ( i );
s2.insert ( i * i );
s3.insert ( i - 1 );
s4.insert ( i );
}
if ( s1 <= s2 )
cout << "The multiset s1 is less than "
<< "or equal to the multiset s2." << endl;
else
cout << "The multiset s1 is greater than "
<< "the multiset s2." << endl;
if ( s1 <= s3 )
cout << "The multiset s1 is less than "
<< "or equal to the multiset s3." << endl;
else
cout << "The multiset s1 is greater than "
<< "the multiset s3." << endl;
if ( s1 <= s4 )
cout << "The multiset s1 is less than "
<< "or equal to the multiset s4." << endl;
else
cout << "The multiset s1 is greater than "
<< "the multiset s4." << endl;
}
The multiset s1 is less than or equal to the multiset s2.
The multiset s1 is greater than the multiset s3.
The multiset s1 is less than or equal to the multiset s4.
operator== (multiset)
Testuje, jestli se objekt s více sadami na levé straně operátoru rovná objektu s více sadami na pravé straně.
bool operator!==(const multiset <Key, Traits, Allocator>& left, const multiset <Key, Traits, Allocator>& right);
Parametry
Vlevo
Objekt typu multiset.
Vpravo
Objekt typu multiset.
Návratová hodnota
true je-li více množina na levé straně operátoru rovna multiset na pravé straně operátoru; jinak false.
Poznámky
Porovnání objektů s více sadami je založeno na párovém porovnání jejich prvků. Dvě sady nebo více sad jsou stejné, pokud mají stejný počet prvků a jejich odpovídající prvky mají stejné hodnoty. Jinak jsou nerovné.
Příklad
// multiset_op_eq.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 equal." << endl;
else
cout << "The multisets s1 and s2 are not equal." << endl;
if ( s1 == s3 )
cout << "The multisets s1 and s3 are equal." << endl;
else
cout << "The multisets s1 and s3 are not equal." << endl;
}
The multisets s1 and s2 are not equal.
The multisets s1 and s3 are equal.
operator> (multiset)
Testuje, jestli je objekt s více sadami na levé straně operátoru větší než objekt s více sadami na pravé straně.
bool operator>(const multiset <Key, Traits, Allocator>& left, const multiset <Key, Traits, Allocator>& right);
Parametry
Vlevo
Objekt typu multiset.
Vpravo
Objekt typu multiset.
Návratová hodnota
true je-li více množina na levé straně operátoru větší než multiset na pravé straně operátoru; jinak false.
Poznámky
Porovnání objektů s více sadami je založeno na párovém porovnání jejich prvků. Vztah větší než mezi dvěma objekty je založen na porovnání prvního páru nerovných prvků.
Příklad
// multiset_op_gt.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 - 1 );
}
if ( s1 > s2 )
cout << "The multiset s1 is greater than "
<< "the multiset s2." << endl;
else
cout << "The multiset s1 is not greater "
<< "than the multiset s2." << endl;
if ( s1 > s3 )
cout << "The multiset s1 is greater than "
<< "the multiset s3." << endl;
else
cout << "The multiset s1 is not greater than "
<< "the multiset s3." << endl;
}
The multiset s1 is not greater than the multiset s2.
The multiset s1 is greater than the multiset s3.
operator>= (multiset)
Testuje, jestli je objekt s více sadami na levé straně operátoru větší nebo roven objektu s více sadami na pravé straně.
bool operator!>=(const multiset <Key, Traits, Allocator>& left, const multiset <Key, Traits, Allocator>& right);
Parametry
Vlevo
Objekt typu multiset.
Vpravo
Objekt typu multiset.
Návratová hodnota
true je-li více množina na levé straně operátoru větší než nebo rovna více množině na pravé straně seznamu; jinak false.
Poznámky
Porovnání objektů s více sadami je založeno na párovém porovnání jejich prvků. Vztah mezi dvěma objekty je větší než nebo rovno na základě porovnání prvního páru nerovných prvků.
Příklad
// multiset_op_ge.cpp
// compile with: /EHsc
#include <set>
#include <iostream>
int main( )
{
using namespace std;
multiset <int> s1, s2, s3, s4;
int i;
for ( i = 0 ; i < 3 ; i++ )
{
s1.insert ( i );
s2.insert ( i * i );
s3.insert ( i - 1 );
s4.insert ( i );
}
if ( s1 >= s2 )
cout << "The multiset s1 is greater than "
<< "or equal to the multiset s2." << endl;
else
cout << "The multiset s1 is less than "
<< "the multiset s2." << endl;
if ( s1 >= s3 )
cout << "The multiset s1 is greater than "
<< "or equal to the multiset s3." << endl;
else
cout << "The multiset s1 is less than "
<< "the multiset s3." << endl;
if ( s1 >= s4 )
cout << "The multiset s1 is greater than "
<< "or equal to the multiset s4." << endl;
else
cout << "The multiset s1 is less than "
<< "the multiset s4." << endl;
}
The multiset s1 is less than the multiset s2.
The multiset s1 is greater than or equal to the multiset s3.
The multiset s1 is greater than or equal to the multiset s4.