operator==, operator<=>(std::coroutine_handle)
来自 cppreference.cn
定义于头文件 <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<>。
[编辑] 示例
本节不完整 原因:无示例 |