operator==,!=,<,<=,>,>=,<=>(std::stack)
来自cppreference.com
template<class T, class Container > bool operator==(conststd::stack<T, Container>& lhs, | (1) | |
template<class T, class Container > bool operator!=(conststd::stack<T, Container>& lhs, | (2) | |
template<class T, class Container > bool operator<(conststd::stack<T, Container>& lhs, | (3) | |
template<class T, class Container > bool operator<=(conststd::stack<T, Container>& lhs, | (4) | |
template<class T, class Container > bool operator>(conststd::stack<T, Container>& lhs, | (5) | |
template<class T, class Container > bool operator>=(conststd::stack<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 | 缺失了 所有比较运算符的语义 | 已补充 |