Attribute inference for auto functions?

deadalnix deadalnix at gmail.com
Tue Apr 16 19:06:05 PDT 2013


On Tuesday, 16 April 2013 at 21:40:18 UTC, Timon Gehr wrote:
> I think inferring the return type and inferring the attributes 
> are mostly orthogonal concerns. (and both are unrelated to the 
> 'auto' storage class'.) But since there is precedent for 
> conflating attribute inference with required function bodies, 
> it might be fine.
>

auto is a storage class, so it should be possible to explicitly 
specify the return type :

auto ulong foo() { // Infered pure, nothrow and everything. 
Return type is ulong (would have been int if inferred).
     return 12;
}



More information about the Digitalmars-d mailing list