DIP 57: static foreach

Adam D. Ruppe destructionator at gmail.com
Sun Mar 9 14:53:44 PDT 2014


On Sunday, 9 March 2014 at 21:47:17 UTC, bearophile wrote:
> suggest to add to DIP57 one more thing: that the introduction 
> of static foreach should come with a warning against the usage 
> of not-static foreach on tuples (and eventually this warning 
> should become a deprecation message).


I don't agree because foreach on a tuple is just plain foreach. 
That it unrolls is just an implementation detail that doesn't 
change much else. I think considering it to be a separate kind of 
loop is like considering foreach over arrays, ranges, and opApply 
items separate loops. Those are just different implementation 
details of the same user concept.


More information about the Digitalmars-d mailing list