演算子の左側のオブジェクトが右側キューのキュー オブジェクトの値以上でテスト。
bool operator>=(
const queue <Type, Container>& _Left,
const queue <Type, Container>& _Right,
);
パラメーター
_Left
queue型のオブジェクト。_Right
queue型のオブジェクト。
戻り値
演算子の左側のキューが null の場合、演算子の右側のキュー未満true ; それ false。
解説
キュー オブジェクトの比較は、要素のペアに比較に基づいています。2 種類のキューは要素の数が同じで、対応する要素の値が同じ同じです。それ以外の場合は等しくありません。
使用例
// queue_op_ge.cpp
// compile with: /EHsc
#include <queue>
#include <iostream>
int main( )
{
using namespace std;
queue <int> q1, q2, q3;
q1.push( 1 );
q1.push( 2 );
q2.push( 5 );
q2.push( 10 );
q3.push( 1 );
q3.push( 2 );
if ( q1 >= q2 )
cout << "The queue q1 is greater than or equal to "
<< "the queue q2." << endl;
else
cout << "The queue q1 is less than "
<< "the queue q2." << endl;
if ( q1>= q3 )
cout << "The queue q1 is greater than or equal to "
<< "the queue q3." << endl;
else
cout << "The queue q1 is less than "
<< "the queue q3." << endl;
}
必要条件
ヘッダー: <queue>
名前空間: std