libunifex icon indicating copy to clipboard operation
libunifex copied to clipboard

Rename is_stop_never_possible to is_stop_ever_possible

Open lewissbaker opened this issue 4 years ago • 2 comments

The usage of this query quite often ends up needing to be negated which ends up with a double negative (not is stop never possible) instead of the positive form (is stop ever possible).

eg.

if constexpr (!is_stop_never_possible_v<StopToken>) {
  // handle possibility of stop being requested
}

Inverting this and using the positive form would allow this code to read better:

if constexpr (is_stop_ever_possible_v<StopToken>) {
  // handle possibility of stop being requested.
}

lewissbaker avatar Mar 13 '20 00:03 lewissbaker

Hi Sir @lewissbaker . Can I work on this issue?

Akshit6828 avatar May 02 '21 17:05 Akshit6828

The current implementation does not work in MSVC. It also requires default constructability from a StopToken that can never be stopped, which is not required by the StopToken concept. For a possible fix of the first issue see: https://godbolt.org/z/z3d75or3M

Tradias avatar Dec 24 '21 11:12 Tradias