static property without return type

Jonathan M Davis jmdavisProg at gmx.com
Sat Mar 16 19:41:03 PDT 2013


On Sunday, March 17, 2013 02:06:08 Andrej Mitrovic wrote:
> On 3/17/13, Timon Gehr <timon.gehr at gmx.ch> 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.

- Jonathan M Davis


More information about the Digitalmars-d mailing list