tuple(...).each error; why does foreach work and std.algorithms.each doesn't ?

Adam D. Ruppe destructionator at gmail.com
Tue Feb 11 19:05:19 UTC 2020


On Tuesday, 11 February 2020 at 18:55:45 UTC, wjoe wrote:
> What's a compiler list... is that something like a tuple?

Yea, they are frequently called tuples too. It is basically just 
a list of arguments used for a function call that the compiler 
treats somewat magically.

> Is it possible to partially expand like:
>
> void fn(int, uint) {}
> and ARGS(string, int, uint)
> and call fn(args[1..$]);

Yes, slicing is the exact syntax for it. You can slice and index 
as if it were an array.


More information about the Digitalmars-d-learn mailing list