On Tuesday, 11 February 2020 at 18:11:44 UTC, wjoe wrote:
In my mind, if something works with foreach, it should also work with std.algorithm.each.

They are very different, the each thing only works for ranges whereas foreach works with a variety of things.

How is 1) different from 2) ?

The ARGS... is a compiler list and can have multiple different types included. Moreover, it will auto-expand when you use it to call a function etc.

You can sometimes do [args] - with the [] around it to turn into an array. Then you can .each it and so on. But they must already be of compatible types to do that since an array elements must all be the same thing.

I would suggest just using foreach for this.

Reply via email to