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