@mutable

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 23 03:15:16 PST 2016


On 22.02.2016 19:03, Nick Treleaven wrote:
> On Monday, 22 February 2016 at 17:28:03 UTC, Guillaume Chatelet wrote:
>>> static make() {
>>
>> The return type is missing for the make() function:
>
> I'm pretty sure static here works just like 'static auto'. In D I think
> you can use storage classes (and even attributes) to imply auto:
>
> const foo(){return 5;}
>
> assert(foo() == 5);

It does not really "imply auto". 'auto' means nothing in this context, 
it's just a crutch for  the parser. The return type is deduced if it is 
left out. In order to leave it out, you need to provide some storage 
class. 'auto' is just one possibility.


More information about the Digitalmars-d mailing list