operator< (<queue>)
Sıra nesnesinin işlecinin sol tarafındaki sağ tarafındaki sıra nesnesi azsa sınar.
bool operator<(
const queue <Type, Container>& _Left,
const queue <Type, Container>& _Right,
);
Parametreler
_Left
Bir nesne türü sıra._Right
Bir nesne türü sıra.
Dönüş Değeri
gerçek işlecinin sol tarafındaki sıra sıra; işlecinin sağ tarafındaki eşit değildir ve daha az ise Aksi halde yanlış.
Notlar
Sıra nesneleri arasında karşılaştırma öðelerinin yapılandırdı Karşılaştırmasında esas alır.Less-iki sıra nesneleri arasındaki ilişki ilk çifti eşit olmayan öğelerin Karşılaştırmasında dayalı çok.
Örnek
// queue_op_lt.cpp
// compile with: /EHsc
#include <queue>
#include <iostream>
int main( )
{
using namespace std;
// Declares queues with default deque base container
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 less than the queue q2." << endl;
else
cout << "The queue q1 is not less than the queue q2." << endl;
if ( q1 < q3 )
cout << "The queue q1 is less than the queue q3." << endl;
else
cout << "The queue q1 is not less than the queue q3." << endl;
}
Gereksinimler
Başlık: <queue>
Namespace: std