Hello, folks! Newbie to D, have some questions!
H. S. Teoh via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Mon Feb 20 12:02:47 PST 2017
On Mon, Feb 20, 2017 at 05:39:30PM +0000, ketmar via Digitalmars-d-learn wrote:
> Ali Çehreli wrote:
>
> > Correction: It's actually the 'auto attribute' in D with the
> > venerable responsibility of "The auto attribute is used when there
> > are no other attributes and type inference is desired." Good job,
> > auto! :o)
>
> foreach (auto n; arr)
>
> oops. good job, auto!
Haha... in this case you want to actually just drop `auto` completely.
:-D
But yeah, there are some funny inconsistencies in what exactly `auto` is
supposed to mean. Hard to say whether this case should be considered a
bug, though. In any case, it's only a trivial one.
T
--
"I'm running Windows '98." "Yes." "My computer isn't working now." "Yes, you already said that." -- User-Friendly
More information about the Digitalmars-d-learn
mailing list