On Sunday, 17 March 2013 at 02:41:18 UTC, Jonathan M Davis wrote:
On Sunday, March 17, 2013 02:06:08 Andrej Mitrovic wrote:
On 3/17/13, Timon Gehr <[email protected]> wrote:
> No, if the return type is missing, it is deduced.

What are you talking about? You can't write:

foo() { return 0; }

> 'auto' does not mean type deduction! It's a crutch for the > parser. In > fact, the meaning of 'auto' is basically carried over > unchanged from C.

auto means something completely different in C.

Yeah. All auto means in C is that the variable has local lifetime. At this point, in C, it's completely pointless, because that's the default (you'd have
to use something like static or register to make it otherwise).

D's auto is the basically the same as C++11's auto, which means that the type
is inferred, which is something completely different.


Timon is right. D need at least one storage class to trigger type inference. auto is basically a storage class that does nothing in D.

Reply via email to