cplusplus.com cplusplus.com
cplusplus.com   C++ : Reference : STL Containers : queue : operators
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forum
Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
STL Containers
bitset
deque
list
map
multimap
multiset
priority_queue
queue
set
stack
vector
queue
comparison operators
queue::queue
member functions:
· queue::back
· queue::empty
· queue::front
· queue::pop
· queue::push
· queue::size

-

comparison operators function
template <class T, class Container>
  bool operator== ( const queue<T,Container>& x, const queue<T,Container>& y );
template <class T, class Container>
  bool operator< ( const queue<T,Container>& x, const queue<T,Container>& y );
template <class T, class Container>
  bool operator!= ( const queue<T,Container>& x, const queue<T,Container>& y );
template <class T, class Container>
  bool operator> ( const queue<T,Container>& x, const queue<T,Container>& y );
template <class T, class Container>
  bool operator>= ( const queue<T,Container>& x, const queue<T,Container>& y );
template <class T, class Container>
  bool operator<= ( const queue<T,Container>& x, const queue<T,Container>& y );
<queue>

Global comparison operator functions

These overloaded global operator functions perform the appropriate comparison operation between queue container adaptors x and y.

Operations == and != are performed by comparing the elements using algorithm equal.

Operations <, >, <= and >= are performed by using algorithm lexicographical_compare, which requires that the type of the elements (T) has the < operation (less-than) defined between two objects of that type.

These operators are overloaded in header <queue>.

Parameters

x, y
queue container adaptors, having both the same template parameters (T and Container).

Return Value

true if the condition holds, and false otherwise.

© The C++ Resources Network, 2000-2007 - All rights reserved
Spotted an error? - contact us