A simple way to implement it is to define few magic variables inside the
std.intrinsic module, and then allow them to be used only inside an if, alone,
like this:
import std.intrinsic: overflow_flag;
if (overflow_flag) {...} else {...}
But magic variables are not tidy. So a tidier solution is to turn them into
boolean functions that the compiler manages in a special way, as the other
intrinsics:
bool o = if overflow_flag();
Or:
if (overflow_flag()) {...} else {...}
But then the compiler has to manage them efficiently (for example here using a
single JNO or JO instruction).
Bye,
bearophile