Hi,

The following works as expected:

auto range = [1, 2, 3, 4, 5];
foreach (i, el; range) {
        writeln(i, ": ", el);
}

but this slight modification doesn't:

auto range = iota(5);
foreach (i, el; range) {
        writeln(i, ": ", el);
}

DMD 2.078.3 says:
Error: cannot infer argument types, expected 1 argument, not 2

The error message is not helpful either, because indicating the types, as in:

foreach (int i, int el; range) { ... }

throws the same error.
What's going on here?

Arredondo

Reply via email to