function
<stack>

std::relational operators (stack)

(1)
template <class T, class Container>
  bool operator== (const stack<T,Container>& lhs, const stack<T,Container>& rhs);
(2)
template <class T, class Container>
  bool operator!= (const stack<T,Container>& lhs, const stack<T,Container>& rhs);
(3)
template <class T, class Container>
  bool operator<  (const stack<T,Container>& lhs, const stack<T,Container>& rhs);
(4)
template <class T, class Container>
  bool operator<= (const stack<T,Container>& lhs, const stack<T,Container>& rhs);
(5)
template <class T, class Container>
  bool operator>  (const stack<T,Container>& lhs, const stack<T,Container>& rhs);
(6)
template <class T, class Container>
  bool operator>= (const stack<T,Container>& lhs, const stack<T,Container>& rhs);
Relational operators for stack
Performs the appropriate comparison operation between lhs and rhs.

Each of these operator overloads calls the same operator on the underlying container objects.

Parameters

lhs, rhs
stack objects (to the left- and right-hand side of the operator, respectively).

Return Value

true if the condition holds, and false otherwise.

Complexity

Constant
Linear in both lhs and rhs's sizes.

Complexity

Constant (a single call to the comparison operator on the underlying containers). Although notice that this operation on the underlying containers is itself up to linear in the size of the smaller object for standard containers.

Data races

Both containers, lhs and rhs, are accessed.
Up to all of their contained elements may be accessed.

Exception safety

Provides the same level of guarantees as the operation performed on the container.

See also