auto

Jari-Matti Mäkelä jmjmak at utu.fi.invalid
Wed Jun 20 05:41:18 PDT 2007


Hoenir wrote:

> 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;"?

One day you may want to write

class foo(a = int, b = int) { }

void main() {
  auto bar = new foo!(foo!( foo!(foo!(), foo!()), foo!(foo!(), foo!()) ),
foo!(foo!(), foo!()));
}


More information about the Digitalmars-d-learn mailing list