Attribute inference for auto functions?

Walter Bright newshound2 at digitalmars.com
Fri Apr 19 12:06:36 PDT 2013


On 4/19/2013 6:55 AM, deadalnix wrote:
> As of for 2 I'd rather have a standard way to have attribute binding to the
> return type or the declaration. This is a recurring problem, and auto is simply
> one instance of it.

I'm not understanding it being a recurring problem. There is a recurring 
misunderstanding that attributes are applying to a type when they are defined as 
applying to the declaration.

> auto applied to the return type means that we infers the return type, applied to
> the function it means infers return type AND attributes.

auto never applies to a type, it always applies to the declaration and hence the 
type of that declaration.


More information about the Digitalmars-d mailing list