auto

Jarrett Billingsley kb3ctd2 at yahoo.com
Wed Jun 20 05:42:49 PDT 2007


"Hoenir" <mrmocool at gmx.de> wrote in message 
news:f5b64b$1aeq$1 at digitalmars.com...
>I still can't get the purpose of "auto".
> I know it makes it possible to e.g. write "auto y = 4u;" but why not just 
> "uint y = 4;"?

I agree in this case, and I think some people get a little 
type-inference-happy.  But it's very useful in the cases that Derek and 
mwarning have posted, and I use it a lot in templates as well (rather than 
picking apart a complex type to determine the correct type for a variable, 
just use auto). 




More information about the Digitalmars-d-learn mailing list