J
Jason Heyes
Are the side effects of evaluating expr1 resolved before expr2 is evaluated?
if (expr1 && expr2)
Thanks.
if (expr1 && expr2)
Thanks.
Are the side effects of evaluating expr1 resolved before expr2 is evaluated?
if (expr1 && expr2)
Thanks.
Alf P. Steinbach said:* Jason Heyes:
Do get yourself a copy of the standard.
The answer is yes, except destruction of temporaries.
Now find which paragraph in the standard says exactly that! ;-)
I rarely need to refer to the standard directly (never, in fact). So why
should I start now?
Alf P. Steinbach said:* Jason Heyes:
You needed it now, so the 'never' is incorrect.
Presumably the 'rarely' is also incorrect.
You should start now so that you do your work yourself instead of
asking others to do it for you.
Jason Heyes said:Does this mean I can't ask questions here anymore?
Are the side effects of evaluating expr1 resolved before expr2 is evaluated?
if (expr1 && expr2)
Sharad Kala said:Not at all. I think the point Alf is making is that to write correct and
authoritative programs one needs to have a copy of Standard. As you may be
aware that not always compilers get correct results. What do you do then ?
The answer is the Holy Standard. But I do agree that if you don't require
to
use C++ daily, or in depth then probably Standard is not what you may want
to read. But for a serious C++ programmer it is a must.
Jason Heyes said:news:[email protected]...
Ok I understand. Where can I get the standard?
Siemel said:Yes, but only if expr1 and expr2 evaluate to fundamental types (eg. bool or
int). This is called short circuting.
Jason said:[redacted]
Ok I understand. Where can I get the standard?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.