[Qt-interest] What is the best, "for" or "foreach"?

Paul Colby qt at colby.id.au
Sat Nov 28 02:10:34 CET 2009


On Sat, Nov 28, 2009 at 12:02 PM, Sean Harmer
<sean.harmer at maps-technology.com> wrote:
>
> Also foreach is quicker if you use a const ref. i.e.
>
> foreach( const int& var, list )
>     doSomething( var );
>

It hadn't occurred to me that a const ref could be used there...
thanks for pointing that out! :)

paul.
-- 
http://colby.id.au




More information about the Qt-interest-old mailing list