GorNishanov / coroutines-ts

20 stars 2 forks source link

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

Open lewissbaker opened 6 years ago

lewissbaker commented 6 years ago

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?