On Wednesday 02 March 2016 17:59:05 Thiago Macieira wrote:
> On quarta-feira, 2 de março de 2016 08:52:10 PST Koehne Kai wrote:
> > Fair enough, I didn't want to imply otherwise. But I read your statement
> > as 'don't dare to use range-for unless you test with MSVC yourself',
> > which is IMO  too much to ask for.
> > 
> > The rule of thumb I got is "use ranged-for with curly brackets". Doesn't
> > this cover it?
> 
> Maybe. Who knows, the parser is buggy!

Having introduced the most range-fors into Qt of all developers over the last 
weeks, I have come across only one issue, and it's the one from the bug 
report:

   for ( ... : ... )
        do { ... } while

As in, e.g.,

   for (... : ...)
       QCOMPARE(..., ...)

I think it's safe to say that range-for works as expected in so vast a 
majority of cases that the CI can be used to catch the rest. Without violating 
the Qt Code Formatting Guidelines and putting {} around each range-for loop 
body.

Thanks,
Marc

-- 
Marc Mutz <[email protected]> | Senior Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
Tel: +49-30-521325470
KDAB - The Qt Experts
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to