Attribute inference for auto functions?

Timon Gehr timon.gehr at gmx.ch
Tue Apr 16 14:40:17 PDT 2013


On 04/16/2013 05:22 PM, Andrei Alexandrescu wrote:
> There's a discussion that may be of interest to the larger community:
> https://github.com/D-Programming-Language/dmd/pull/1877
>
> Andrei

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.

In order not to be hit by Kenji's worst case debug output scenario, use 
something like the following:

void dw(T...)(T args)pure nothrow @trusted{
     debug try{writeln(args);}catch{assert(0);}
     else static assert(0);
}



More information about the Digitalmars-d mailing list