Home

Hi,

I believe the x86 type of procesors expect to fall through (thus if compiled
'litterally' the if condition being true).

However if your compiler does or doesn't optimize for that one can only
guess. I would recommend to just try it (and still then it might depend on
the condition).


Regards, Ron AF Greve

http://www.InformationSuperHighway.eu

<aeismail@gmail.com> wrote in message
news:1190219560.652873.190320@k35g2000prh.googlegroups.com...
> Hi, everybody:
>
> A quick question regarding how to write if/then blocks.
>
> Do C++ compilers care in terms of execution (i.e., efficiency) which
> block in an if/then/else loop is executed? That is, will going to the
> "else" block be less efficient than using the "then" block?
>
> My question comes because I want to know if there is any advantage in
> writing the test condition to favor one block over the other. (For the
> code I'm working with, one case is definitely preferred over the
> other--at least 2 to 1.)
>
> Thanks,
>
> --AEI
>

previous
next

Re: [xpost] a new C/C++ type that when overflow i see it
Re: Puzzled by "is"
Re: Why Java Fail and C++ rise
Re: Help with Dictionaries and Classes requested please.
Re: vector has segfault null dereference
meble biurowe
LG Shine
Niszczenie Warszawa
Sony Ericsson C905
wystrój okien