On Friday, 15 June 2012 at 10:01:42 UTC, Dmitry Olshansky wrote:
Suggest you revisit toNode function as it does return
something strange :)
Just looking at first - last lines:
pure nothrow auto toNode(R)(R range, immutable(Maybe!Node)
parent) if(isInputRange!R && hasLength!R)
....
auto result = new Node[](range.length);
foreach(e; range) result ~= toNode2(e);
return cast(immutable) range; // <<<<---- WAT
}
And no need to cast to immutable, compiler will infer things
automatically since it's pure. (and correctly for both
mutable/immutable)
Thanks, fixed. This is the result of not writing tests first :)