operators (std::deque)
template< class T, class Alloc > bool operator==( const deque<T,Alloc>& lhs, const deque<T,Alloc>& rhs ); | (1) | |
|---|---|---|
template< class T, class Alloc > bool operator!=( const deque<T,Alloc>& lhs, const deque<T,Alloc>& rhs ); | (2) | |
template< class T, class Alloc > bool operator<( const deque<T,Alloc>& lhs, const deque<T,Alloc>& rhs ); | (3) | |
template< class T, class Alloc > bool operator<=( const deque<T,Alloc>& lhs, const deque<T,Alloc>& rhs ); | (4) | |
template< class T, class Alloc > bool operator>( const deque<T,Alloc>& lhs, const deque<T,Alloc>& rhs ); | (5) | |
template< class T, class Alloc > bool operator>=( const deque<T,Alloc>& lhs, const deque<T,Alloc>& rhs ); | (6) | |
比较两个容器的内容。
1-2%29检查lhs和rhs是平等的,也就是说,无论lhs.size() == rhs.size()每一个元素lhs中的元素相等。rhs在同一位置。
3-6%29比较lhs和rhs按字典顺序。比较由一个相当于std::lexicographical_compare...
参数
lhs, rhs | - | containers whose contents to compare |
|---|
-T必须满足“公平比较”的要求,才能使用过载%281-2%29。
T必须满足LessThanable的要求,才能使用过载%283-6%29。订货关系必须建立总秩序。
返回值
1%29true如果容器的内容相等,false不然的话
2%29true如果容器的内容不相等,false不然的话
3%29true如果lhs按字典顺序再少点比…的内容rhs,,,false不然的话
4%29true如果lhs按字典顺序再少点比或平等...的内容rhs,,,false不然的话
5%29true如果lhs按字典顺序更大比…的内容rhs,,,false不然的话
6%29true如果lhs按字典顺序更大比或平等...的内容rhs,,,false不然的话
复杂性
容器的大小成线性。
© cppreference.com在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

