On Wednesday, 18 November 2015 at 12:20:42 UTC, maik klein wrote:
https://stackoverflow.com/questions/33779822/unable-to-call-each-on-a-lockstep-range-containing-2-or-more-ranges

http://dpaste.dzfl.pl/76c79f1f12ab

void main(){
  import std.container;
  import std.stdio;
  import std.algorithm.iteration;
  import std.range;
  Array!int ai = [1,2,3,4];
  Array!int ai1 = [1,2,3,4];
  Array!int ai2 = [1,2,3,4];

  auto arange = lockstep(ai[],ai1[]);
  arange.each!((a,b) => writeln(a, b));

  auto arange2 = lockstep(ai[],ai1[],ai2[]);
  arange2.each!((a,b,c) => writeln(a, b, c));
}

Error: template std.algorithm.iteration.each cannot deduce function from argument types !((a, b, c) => writeln(a, b, c))(Lockstep!(RangeT!(Array!int), RangeT!(Array!int), RangeT!(Array!int))), candidates are: /opt/compilers/dmd2/include/std/algorithm/iteration.d(820):
std.algorithm.iteration.each(alias pred = "a")


"arange" works but "arange2" doesn't because the compiler is unable to deduce the the function. The error even appears if I explicitly add the argument types.

Which version of the compiler are you using?

Reply via email to