On 07/02/2012 05:36 PM, Joseph Rushton Wakeling wrote:
Hello all,

A problem with the retro function from std.range -- although it
apparently operates on a bidirectional range, it fails when used with
foreach requesting both value and index.  Running this code:

////////////////////////////////////////////////
import std.range, std.stdio;

void main()
{
       double[] a = [ 0, 1, 2, 3, 4, 5 ];

       foreach(i, x; retro(a))
             writeln(i, "\t", x);
}
////////////////////////////////////////////////

... results in an error: "cannot infer argument types".

Is there any reason why this should be so, or is it (as it seems to me)
just a bug?

Thanks & best wishes,

     -- Joe

What would be your expected output?

Reply via email to