static property without return type

Artur Skawina art.08.09 at gmail.com
Sun Mar 17 12:34:55 PDT 2013


On 03/17/13 19:48, Andrej Mitrovic wrote:
> On 3/17/13, Peter Alexander <peter.alexander.au at gmail.com> wrote:
>> auto in D actually just means "I don't want to use any other storage class"
> 
>>From the user's perspective auto means more:
> 
> int x;
> ref refRet() { return x; }  // ok
> ref refRet() { return 1; }  // disallowed
> 
> auto ref autoRet() { return x; }  // ok
> auto ref autoRet() { return 1; }  // ok
> 

That's because "auto ref" is a hack.
IOW "auto ref" != "auto" + "ref", just as "static if" != "static" + "if".

artur


More information about the Digitalmars-d mailing list