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

请参见

参考

标准模板库