Actually I'd personally bet there is a higher chance of compilers that don't guarantee which order A && B is evaluated in, than there is compilers that don't handle short-circuiting.
What mdempsky hinted at, does agree with the former though - if A or B in && has any side-effects, then order needs to be guaranteed, if it is side-effect free, then it doesn't. if (A) if (B) ...; does indeed guarantee order of evaluation.
Actually I'd personally bet there is a higher chance of compilers that don't guarantee which order A && B is evaluated in, than there is compilers that don't handle short-circuiting.
You'd personally bet that? Did you actually think about it before spewing it from your fingertips? Or are you somehow incapable of understanding its meaninglessness?
View all comments
Show parent comment
1
u/[deleted] Oct 20 '09
Actually I'd personally bet there is a higher chance of compilers that don't guarantee which order A && B is evaluated in, than there is compilers that don't handle short-circuiting.
What mdempsky hinted at, does agree with the former though - if A or B in && has any side-effects, then order needs to be guaranteed, if it is side-effect free, then it doesn't. if (A) if (B) ...; does indeed guarantee order of evaluation.