operator==, operator<=> (std::stacktrace_entry)
From cppreference.net
<
cpp
|
utility
|
stacktrace entry
C++
Diagnostics library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::stacktrace_entry
| Member functions | ||||
| Observers | ||||
| Query | ||||
| Non-member functions | ||||
|
operator==
operator<=> |
||||
| Helper classes | ||||
|
friend
constexpr
bool
operator
==
(
const
stacktrace_entry
&
lhs,
const stacktrace_entry & rhs ) noexcept ; |
(1) | (自 C++23 起) |
|
friend
constexpr
std::
strong_ordering
operator <=> ( const stacktrace_entry & lhs, const stacktrace_entry & rhs ) noexcept ; |
(2) | (自 C++23 起) |
1)
比较
lhs
与
rhs
是否相等。两个
stacktrace_entry
值相等当且仅当它们表示相同的堆栈跟踪条目,或者两者均为空。
2)
获取
lhs
与
rhs
在所有
stacktrace_entry
值的未指定严格全序中的相对顺序,该顺序与
operator==
建立的相等关系保持一致。
这些函数对普通的 非限定查找 或 限定查找 不可见,仅当 std::stacktrace_entry 作为参数的关联类时,才能通过 实参依赖查找 找到。
<
、
<=
、
>
、
>=
和
!=
运算符分别由
operator
<=>
和
operator
==
自动合成。
参数
| lhs, rhs | - |
要比较的
stacktrace_entry
值
|
返回值
1)
true
若两个
lhs
与
rhs
比较结果相等,否则为
false
。
2)
当
lhs
与
rhs
比较相等时,返回
std::strong_ordering::equal
。
否则,若在严格全序中
lhs
排列于
rhs
之前,则为
std::strong_ordering::less
。
否则,返回
std::strong_ordering::greater
(此时在严格全序中
rhs
排列于
lhs
之前)。
示例
|
本节内容不完整
原因:缺少示例 |