why foreach() don't use 'auto'?

w0rp devw0rp at gmail.com
Fri Mar 28 17:13:28 PDT 2014


On Friday, 28 March 2014 at 23:29:19 UTC, ketmar wrote:
>> It is documented that code like the above is illegal:
> yes, it is. but i think that 'auto' is a perfect fit there. it 
> shouldn't do anything at all, but it is the convient way to 
> mark variable 'locality'. it will not break any of the existing 
> code yet will bring foreach() in line with 'every variable must 
> be explicitly declared with some type' principle.

Yes, I think this might be a case for a minor thing for allowing 
something trivial which, honestly doesn't really matter, but it's 
sort of a "why not?" thing.


More information about the Digitalmars-d mailing list