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?
Currently the comparison operators for
coroutine_handle<T>
are defined forcoroutine_handle<void>
.This means that it is valid to compare
coroutine_handle<P1>
withcoroutine_handle<P2>
as both are implicitly cast tocoroutine_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 declaredconstexpr
and always returnfalse
?