Namespaces
Variants

operator==, operator<=> (std::coroutine_handle)

From cppreference.net
Utilities library
Coroutine support
Coroutine traits
Coroutine handle
No-op coroutines
Trivial awaitables
Range generators
(C++23)
定义于头文件 <coroutine>
constexpr bool
operator == ( std:: coroutine_handle <> x, std:: coroutine_handle <> y ) noexcept ;
(1) (C++20 起)
(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 的其他特化版本同样支持相等比较和三路比较,因为它们可隐式转换为 std:: coroutine_handle <>

示例