D: Unexpected output when using a delegate and EnumMembers
Timon Gehr
timon.gehr at gmx.ch
Tue Jun 19 08:26:35 PDT 2012
On 06/19/2012 04:44 PM, Travis Gockel wrote:
>
> I am clearly doing something wrong,
You are not.
> but I have no idea what and would
> appreciate some insight.
>
You have found a bug in DMD.
Reduced test case that should compile:
template Seq(T...){alias T Seq;}
auto exec(alias a)(){return a();}
void main(){
foreach(e; Seq!(0, 1))
static assert(exec!(()=>e)()==e);
}
You can report the bug here: http://d.puremagic.com/issues/
The 'exec' template is instantiated only once instead of two times.
More information about the Digitalmars-d-learn
mailing list