operator> (multiset)
演算子の左側の多重セットのオブジェクトが右側のオブジェクトより大きいセット複数のテスト。
bool operator>(
const multiset <Key, Traits, Allocator>& _Left,
const multiset <Key, Traits, Allocator>& _Right
);
パラメーター
_Left
multiset 型のオブジェクト。_Right
multiset 型のオブジェクト。
戻り値
演算子の左側の多重セットが演算子の右側に複数のセットを超える場合true ; それ false。
解説
複数のセット オブジェクトの比較は、要素のペアに比較に基づいています。2 個のオブジェクト間の関係に不等号最初のペアの付いていない要素の比較に基づいています。
使用例
// 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;
}
必要条件
ヘッダー: <set>
名前空間: std