Why no (auto foo = bar) in while loops?

Timon Gehr timon.gehr at gmx.ch
Wed Aug 24 12:29:23 PDT 2011


On 08/24/2011 09:21 PM, Andrej Mitrovic wrote:
> On 8/24/11, Timon Gehr<timon.gehr at gmx.ch>  wrote:
>> it is usually faster
>> in debug mode
>
> Huh.. How come?

Well, not notably faster, but many compilers will emit something in the 
lines of

mov eax, 1
test eax
jnz beginning_of_loop

if no optimizer is run,

whereas most get

for(;;){}

as

jmp beginning_of_loop

even in debug mode.


More information about the Digitalmars-d-learn mailing list