@disable

Leandro Lucarella llucax at gmail.com
Sat Jan 16 07:12:02 PST 2010


Pelle Månsson, el 16 de enero a las 14:00 me escribiste:
> >I don't think so. auto means in D the same that in C/C++, the difference
> >is that D do type inference when a *storage class* is given. const,
> >static, immutable, shared are other storage classs, so when you used
> >them, you can infer the type too (if no type is given).
> >
> >You can do const auto c = 1; (I think), but I can't do static auto c = 1;
> >(I think too). You can omit auto when declaring automatic variables if you
> >specify the type (seen the other way :), because it defaults to auto. And
> >you can omit the type if you use a storage class, because it defaults
> >to the infered type.
> >
> Makes sense, but static auto totally works.

You are right, that's odd... o.O

Even more, auto int x = 0 doesn't even compile:
variable x both auto and explicit type given

> I think auto just means inferred type.

That seems to be the case then... So Ali Çehreli was right and I was
wrong.

I still like my logic better, I will keep thinking that auto is a real
storage class and ignore this whole thread =P

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
Los jóvenes no son solo brazos que nos cargan... También se los puede
mandar a la guerra, que es su obligación.
	-- Ricardo Vaporeso



More information about the Digitalmars-d mailing list