to auto or not to auto ( in foreach )

Seb via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jul 16 13:02:55 PDT 2016


On Saturday, 16 July 2016 at 20:00:39 UTC, Seb wrote:
> On Saturday, 16 July 2016 at 14:11:34 UTC, cym13 wrote:
>> [...]
>
> It's not arbitrary. It keeps the language simple and easy to 
> read. After all the entire auto keyword is just there, because 
> the compiler needs a keyword and in loops it's clearly defined 
> what the type will be.
> You don't complain that `int int` is forbidden, or do you?
>
> I guess you are frustrated because you are used to this pattern 
> from other, inferior languages. I bet you will soon start to 
> appreciate the syntactic sugar that D provides.

However I agree that the error message should be more 
informative. Please open a issue for this ;-)


More information about the Digitalmars-d-learn mailing list