operator==,!=,<,<=,>,>=,<=>(std::stack)
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) | (C++20 起) |
比较两个容器适配器的底层容器。通过应用对应的运算符到底层容器进行比较。
参数
lhs, rhs | - | 要比较内容的迭代器适配器 |
-T
必须符合可相等比较
(EqualityComparable)
的要求。
|
返回值
复杂度
与容器大小呈线性。
缺陷报告
下列更改行为的缺陷报告追溯地应用于以前出版的 C++ 标准。
缺陷报告 | 应用于 | 出版时的行为 | 正确行为 |
---|---|---|---|
LWG 410 | C++98 | 缺失了 所有比较运算符的语义 | 已补充 |