operator==, operator<=> (std::stacktrace_entry)
來自 cppreference.com
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 之前)。
[編輯] 示例
本節不完整 原因:無示例 |