• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: faster?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: faster?


  • Subject: Re: faster?
  • From: Andreas Grosam <email@hidden>
  • Date: Fri, 03 Feb 2012 12:45:11 +0100

On Feb 3, 2012, at 9:49 AM, Luca Ciciriello wrote:

> Hi All.
>
> 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++)
> {
> 	…
> }
>
> Thanks in advance for any answer.
>
> Luca.

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.



Andreas
 _______________________________________________
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


  • Follow-Ups:
    • Re: faster?
      • From: Sean McBride <email@hidden>
References: 
 >faster? (From: Luca Ciciriello <email@hidden>)

  • Prev by Date: faster?
  • Next by Date: Re: faster?
  • Previous by thread: faster?
  • Next by thread: Re: faster?
  • Index(es):
    • Date
    • Thread