Sorry, accidentally submitted before finishing. Anyhow, the following bug makes template literals near useless when used w/ ranges. I think it has to do with the way unaryFun works, but I'm not sure.
import std.algorithm;
struct Foo {
uint num;
}
void main() {
Foo[] foos;
auto bar = map!( (a) { return a.num; } )(foos);
}
C:\dmd\windows\bin\..\..\src\phobos\std\algorithm.d(120): Error: forward reference to type __T2
C:\dmd\windows\bin\..\..\src\phobos\std\algorithm.d(120): Error: cannot implicitly convert expression (Foo) of type Foo to __T2
C:\dmd\windows\bin\..\..\src\phobos\std\algorithm.d(120): Error: forward reference to inferred return type of function call __dgliteral1(cast(__T2)(Foo))
C:\home\dsimcha\bin\test.d(111): Error: template instance test.main.Map!(__dgliteral1,Foo[]) error instantiating
Process terminated with status 1 (0 minutes, 0 seconds)
Comment #2 by dsimcha — 2010-08-15T21:19:28Z
This is one of the many bugs that depended on bug 3294 and therefore got resolved when 3294 did.