to auto or not to auto ( in foreach )
Adam D. Ruppe via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sat Jul 16 19:04:50 PDT 2016
On Sunday, 17 July 2016 at 01:57:21 UTC, pineapple wrote:
> Chipping in my agreement. foreach(x; y) makes as much syntactic
> sense as for(x = 0; x < y; x++) where x was not previously
> defined. One does not expect something that does not look like
> every other variable definition in the language to be defining
> a new variable.
(x) => x; // defines a new variable
foreach isn't alone.
More information about the Digitalmars-d-learn
mailing list