Attribute inference for auto functions?

Rob T alanb at ucora.com
Wed Apr 17 09:05:43 PDT 2013


On Wednesday, 17 April 2013 at 13:59:05 UTC, Peter Alexander 
wrote:
[...]
>
> If you want type inference then you just need to use:
>
> const foo();
>
> And yes, it is by design. The spec is quite clear on this 
> issue. Type inference is signalled by lack of return type -- 
> not the presence of auto. auto is only required when no other 
> storage class is wanted, to make the parser happy. auto is 
> nothing whatsoever to do with type inference.

I think you've made some good clarification points.

auto is used only when there is no other storage class, and 
"storage class" is a somewhat misleading term because some 
storage class's seem to have nothing to do with "storage".

The point you made, is that what is being proposed is if or if 
not D should be extended to perform attribute inference along 
with type inference. The auto keyword is only required when no 
other storage class is specified, so it really means that 
attribute inference will be done all the time unless you 
specifically specify the attributes.

Is this the case?

--rt


More information about the Digitalmars-d mailing list