operator==, operator<=> (std::stacktrace_entry)
来自 cppreference.cn
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) 如果 lhs 和 rhs 比较相等,则为 true,否则为 false。
2) 如果 lhs 和 rhs 比较相等,则为 std::strong_ordering::equal。
否则,如果 lhs 在严格全序中排在 rhs 之前,则为 std::strong_ordering::less。
否则,为 std::strong_ordering::greater (在这种情况下,rhs 在严格全序中排在 lhs 之前)。
[编辑] 示例
本节不完整 原因:无示例 |