I want to print the contents of Array!int

import std.stdio;
import std.container;

void pr(Array!int a) {
        foreach(i, v; a[]) {
                writeln("%4s: %s\n", i, v);
        }
}

But when I compile it by DMD 2.062 on Windows
it says:

testArray.d(5): Error: cannot infer argument types
(line 5 is at "foreach(i, v; a[]) {" )

What's wrong? how can I iterate the array?

Thanks, aki.

Reply via email to