operator==, operator<=>(std::coroutine_handle)
來自 cppreference.com
定義於標頭檔案 <coroutine> |
||
constexpr bool operator==( std::coroutine_handle<> x, std::coroutine_handle<> y ) noexcept; |
(1) | (C++20 起) |
constexpr std::strong_ordering operator<=>( std::coroutine_handle<> x, std::coroutine_handle<> y ) noexcept; |
(2) | (C++20 起) |
根據兩個 std::coroutine_handle<> 值 x 與 y 的底層地址比較它們。
運算子 <
、<=
、>
、>=
及 !=
分別由 operator<=> 和 operator== 合成。
目錄 |
[編輯] 引數
x, y | - | 要比較的 std::coroutine_handle<> 值 |
[編輯] 返回值
1) x.address() == y.address()
2) std::compare_three_way{}(x.address(), y.address())
[編輯] 注意
雖然這些運算子僅為 std::coroutine_handle<> 過載,但 std::coroutine_handle 的其他特化也滿足相等比較 (equality comparable) 和三路比較 (three-way comparable),因為它們能隱式轉換到 std::coroutine_handle<>。
[編輯] 示例
本節不完整 原因:無示例 |