Suppose I could make an inline function like
int or(int x, int y) {
if (x) return x;
return y;
}
Suppose I could make an inline function like
int or(int x, int y) {
if (x) return x;
return y;
}
ok i think this will work even if nested, without statement expressions (so will compile on MSVC)
ORV(x, y) (tmp = (x) ? tmp : (y))
ANDV(x, y) (tmp = (x) ? (y) : tmp)
the AND version felt dicey but i realized that if you get to the (y) expression the tmp value is never evaluated so it's fine if it gets clobbered
@eniko If you do you own function, why don't use if/then/else instead of 'risking' with the ? thing ? .. At this point I won't change too much I suppose.
@gilesgoat because you can't do if/then/else inline in an expression