2 ms·
If you know it is always true, why is it in an if() ? You'd right it as: int x; if (somethingThatYouKnowIsTrueButTheCompilerDoesnt()) x = 3;
by WalterBright 12y ago
If you know it is always true, why is it in an if() ? You'd right it as:
int x;
if (somethingThatYouKnowIsTrueButTheCompilerDoesnt())
x = 3;
else
assert(0);
and the compiler will remove the redundant store to x.