class C
{
void f(int i)()
{
}
void g()
{
foreach (i; Range!(1,10))
f!(i)();
}
}
Error: template instance cannot use local 'i' as parameter to non-global template f(uint i)
I think it should work.
Comment #1 by yanikibo — 2010-11-27T10:37:15Z
The code below works:
class C
{
void f(int i)()
{
}
void g()
{
foreach (i; Range!(1,10))
h!(i)(this);
}
}
void h(int i)(C c)
{
c.f!(i)();
}
Probably that is only a compiler limitation and can be fixed (or removed) without much effort.