C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] dofor loop
From: Matthew Woehlke (mwoehlke.floss_at_[hidden])
Date: 2019-12-27 10:39:27


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

STD-PROPOSALS list run by std-proposals-owner@lists.isocpp.org

Standard Proposals Archives on Google Groups