Re: faster?
Re: faster?
- Subject: Re: faster?
- From: Alex Zavatone <email@hidden>
- Date: Fri, 03 Feb 2012 09:28:51 -0600
Why are you asking this question?
Write the milliseconds into a variable before the loop and write them into a variable after the loop. When done, output the results.
Run each 3 times to eliminate and outlying cases.
Look at the output.
That's how you find out.
On Feb 3, 2012, at 9:20 AM, Sean McBride wrote:
> On Fri, 3 Feb 2012 12:45:11 +0100, Andreas Grosam said:
>
>>> In my C++ code I'm using the libc++ library and my question is about
>> which construct is faster:
>>>
>>> for(auto line : lines)
>>> {
>>> ...
>>> }
>>>
>>> or
>>>
>>> for(auto it = lines.begin(); it != lines.end(); it++)
>>> {
>>> …
>>> }
>>
>> The auto keyword reduces verbosity only - and makes the code more
>> generic. A compiler should not generate different code - provided the
>> containers 'lines' are of the same type.
>
> Not so sure about that. Consider the points raised here:
>
> <http://llvm.org/docs/CodingStandards.html#ll_end>
> <http://llvm.org/docs/CodingStandards.html#micro_preincrement>
>
> But this seems off-topic for this list...
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng email@hidden
> Rogue Research www.rogue-research.com
> Mac Software Developer Montréal, Québec, Canada
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >faster? (From: Luca Ciciriello <email@hidden>) |
| >Re: faster? (From: Andreas Grosam <email@hidden>) |
| >Re: faster? (From: Sean McBride <email@hidden>) |