operator==,!=,<,<=,>,>=,<=>(std::queue)
来自 cppreference.cn
template< class T, class Container > bool operator==( const std::queue<T, Container>& lhs, |
(1) | |
template< class T, class Container > bool operator!=( const std::queue<T, Container>& lhs, |
(2) | |
template< class T, class Container > bool operator< ( const std::queue<T, Container>& lhs, |
(3) | |
template< class T, class Container > bool operator<=( const std::queue<T, Container>& lhs, |
(4) | |
template< class T, class Container > bool operator> ( const std::queue<T, Container>& lhs, |
(5) | |
template< class T, class Container > bool operator>=( const std::queue<T, Container>& lhs, |
(6) | |
template< class T, std::three_way_comparable Container > std::compare_three_way_result_t<Container> |
(7) | (C++20 起) |
比较两个容器适配器底层容器的内容。比较是通过将相应的运算符应用于底层容器来完成的。
目录 |
[编辑] 参数
lhs, rhs | - | 要比较其内容的容器适配器 |
-T 必须满足 EqualityComparable 的要求。 |
[编辑] 返回值
1-6) 如果对应的比较结果为 true 则返回 true,否则返回 false。
7) 底层容器三路比较的结果。
[编辑] 复杂度
与容器大小成线性关系。
[编辑] 示例
本节不完整 原因:无示例 |
缺陷报告
下列更改行为的缺陷报告追溯地应用于以前出版的 C++ 标准。
缺陷报告 | 应用于 | 发布时的行为 | 正确的行为 |
---|---|---|---|
LWG 410 | C++98 | 运算符 != , > , <= 和 >= 的语义缺失 |
已添加 |