共用方式為


operator>= (<queue>)

測試,如果在運算子左方的佇列對像是大於或等於右邊的佇列應用程式。

bool operator>=( 
   const queue <Type, Container>& _Left, 
   const queue <Type, Container>& _Right, 
);

參數

  • _Left
    型別 queue物件。

  • _Right
    型別 queue物件。

傳回值

true ,如果在運算子左方的佇列明顯小於佇列在運算子右方的;否則 false

備註

在佇列物件之間的比較可能會依據其項目比較配對。 兩個佇列是相等的,如果它們有相同的元素數,且其元素具有相同的值。 否則就是不相等。

範例

// 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;
}
  

需求

標題: <佇列>

命名空間: std

請參閱

參考

標準樣板程式庫