C++ Logo

std-proposals

Advanced search

Re: dofor loop

From: Thiago Macieira <thiago_at_[hidden]>
Date: Fri, 27 Dec 2019 11:49:42 -0300
On Friday, 27 December 2019 08:31:40 -03 Михаил Найденов via Std-Proposals
wrote:
> Note that raw loops are out of fashion right now. Also, there are arguably
> too many iteration statements already, considering all can be expressed
> with one or two of the existing ones.
> Can you give some compelling examples.

And by compelling, please make them REALLY compelling. They should be
something that is MUCH clearer than any existing method of doing the same.

Your example of printing the indices of an array is contrived and trivial. It
shows no useful work and can be implemented in a dozen different ways.
Besides, all it really shows is that the containers should have used signed
integers for indices, not unsigned.

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.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel System Software Products

Received on 2019-12-27 08:52:13