coroutines-ts icon indicating copy to clipboard operation
coroutines-ts copied to clipboard

Should coroutine_handle<P1> == coroutine_handle<P2> be allowed?

Open lewissbaker opened this issue 6 years ago • 0 comments

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?

lewissbaker avatar Dec 09 '17 11:12 lewissbaker