Attribute inference for auto functions?
Walter Bright
newshound2 at digitalmars.com
Wed Apr 17 12:53:04 PDT 2013
On 4/17/2013 12:58 AM, deadalnix wrote:
> Back to the subject, if auto bind to the function it must infers attributes, if
> it binds to the return type, it mustn't. And right now, storage class bind to
> the function.
'auto', like all storage class annotations such as 'const', binds to the
declaration and the declaration's type. It is perfectly consistent.
> extern(C) void function() foo; // does extern binds to foo, foo's type or both ?
foo is being declared, so it binds to foo.
> pure function() function() bar; // is bar a pure function ? is bar() pure ?
Noth ? How to choose ?
bar is being declared, so it binds to bar.
More information about the Digitalmars-d
mailing list