On sexta-feira, 24 de junho de 2016 21:52:15 PDT Thiago Macieira wrote:
> On sexta-feira, 24 de junho de 2016 21:40:31 PDT Nicol Bolas wrote:
> > On Saturday, June 25, 2016 at 12:09:34 AM UTC-4, Thiago Macieira wrote:
> > >
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0305r0.html
> > >
> > > (If statement with initializer) introduces the following syntax:
> > > if ( for-init-statement condition ) statement
> > >
> > > The paper talks about using it for switch too but says that it is not
> > > proposing then. Let's say we accept that the benefit would be small.
> > >
> > > Regular while and for loops already have init statements.
> >
> > Since when do while loops have init statements? Or are you just talking
> > about `for` loops that don't have an increment statement?
>
> I was thinking of how you can declare variables in them, but I didn't think
> it through. It's the same syntax as plain old if, which means that anything
> that applies to if should apply to while too.