coroutines-ts
coroutines-ts copied to clipboard
Should coroutine_handle<P1> == coroutine_handle<P2> be allowed?
Currently the comparison operators for coroutine_handle<T>
are defined for coroutine_handle<void>
.
This means that it is valid to compare coroutine_handle<P1>
with coroutine_handle<P2>
as both are implicitly cast to coroutine_handle<void>
and then compared. However, two coroutine handles with different promise types can never be equal.
Should the equality operator overloads for comparing two coroutine_handle
values of different non-void promise types be declared deleted? Or possibly even declared constexpr
and always return false
?