On Wednesday, 20 April 2022 at 08:37:09 UTC, Salih Dincer wrote:
On Wednesday, 20 April 2022 at 08:04:42 UTC, Salih Dincer wrote:
I get an unexpected result inside the second foreach() loop. Anyone know your reason?

It's my fault, here is the solution:
```d
  foreach(fun; funs)
  {
        range.map!(a => fun(a))
             .reduce!sum
             .write(" "); // Ok!
  }
  writeln; // "1115 188 102 86 47"
```

With the original version, I'm getting expected results with 2.098.1. run.dlang.io with 'dmd' also shows expected results.

Reply via email to