operator==,!=,<,<=,>,>=(std::map) (3) - Linux Manuals

operator==,!=,<,<=,>,>=(std::map): operator==,!=,<,<=,>,>=(std::map)

NAME

operator==,!=,<,<=,>,>=(std::map) - operator==,!=,<,<=,>,>=(std::map)

Synopsis


template< class Key, class T, class Compare, class Alloc >
bool operator==( const std::map<Key,T,Compare,Alloc>& lhs, (1)
const std::map<Key,T,Compare,Alloc>& rhs );
template< class Key, class T, class Compare, class Alloc >
bool operator!=( const std::map<Key,T,Compare,Alloc>& lhs, (2)
const std::map<Key,T,Compare,Alloc>& rhs );
template< class Key, class T, class Compare, class Alloc >
bool operator<( const std::map<Key,T,Compare,Alloc>& lhs, (3)
const std::map<Key,T,Compare,Alloc>& rhs );
template< class Key, class T, class Compare, class Alloc >
bool operator<=( const std::map<Key,T,Compare,Alloc>& lhs, (4)
const std::map<Key,T,Compare,Alloc>& rhs );
template< class Key, class T, class Compare, class Alloc >
bool operator>( const std::map<Key,T,Compare,Alloc>& lhs, (5)
const std::map<Key,T,Compare,Alloc>& rhs );
template< class Key, class T, class Compare, class Alloc >
bool operator>=( const std::map<Key,T,Compare,Alloc>& lhs, (6)
const std::map<Key,T,Compare,Alloc>& rhs );


Compares the contents of two containers.
1-2) Checks if the contents of lhs and rhs are equal, that is, they have the same number of elements and each element in lhs compares equal with the element in rhs at the same position.
3-6) Compares the contents of lhs and rhs lexicographically. The comparison is performed by a function equivalent to std::lexicographical_compare. This comparison ignores the container's ordering Compare.

Parameters


lhs, rhs - containers whose contents to compare
-
T, Key must meet the requirements of EqualityComparable in order to use overloads (1-2).
-
Key must meet the requirements of LessThanComparable in order to use overloads (3-6). The ordering relation must establish total order.

Return value


1) true if the contents of the containers are equal, false otherwise
2) true if the contents of the containers are not equal, false otherwise
3) true if the contents of the lhs are lexicographically less than the contents of rhs, false otherwise
4) true if the contents of the lhs are lexicographically less than or equal the contents of rhs, false otherwise
5) true if the contents of the lhs are lexicographically greater than the contents of rhs, false otherwise
6) true if the contents of the lhs are lexicographically greater than or equal the contents of rhs, false otherwise

Complexity


1-2) Constant if lhs and rhs are of different size, otherwise linear in the size of the container
3-6) Linear in the size of the container