C++ Logo

std-proposals

Advanced search

Re: dofor loop

From: Matthew Woehlke <mwoehlke.floss_at_[hidden]>
Date: Fri, 27 Dec 2019 11:39:27 -0500
On 27/12/2019 09.49, Thiago Macieira via Std-Proposals wrote:
> Note: you're unlikely to get "dofor" as a keyword. Please investigate a new
> syntax that does not involve a new keyword and does not break existing code.

Well, *that* much is easy. If I understand what Menashe is asking for:

  do (init-statement)
  {
    ...statements...
  } for (condition; increment-statement)

...but is it worth it? I just don't know.

(OTOH, I wouldn't mind `do` having an optional init-statement...)

...although that's very close to being an SC break, and I can already
hear compiler vendors complaining about the necessary look-ahead :'(.

-- 
Matthew

Received on 2019-12-27 10:41:56