template in template

Enumerableを書いているのですが、いきなりこけてます。

template.d(4): template template.main.mixin Foo!();
.hoge(T) cannot declare template at function scope hige

つまりmixinのためのテンプレートFooの中で、関数テンプレートhogeを使ったために、テンプレート二重になっちゃってそんなの駄目ですよ、ということらしい。
mixinは絶対に使うので、関数テンプレートは使えないということになるなあ…。

あと。

Assertion failure: 'next' on line 2226 in file 'mtype.c'
abnormal program termination

といわれる。なんだこれ。調査中。