On Saturday, 12 September 2020 at 18:16:51 UTC, mw wrote:
Now, let me expand this challenge: suppose we need to add a new
set of variable length extra parameters in parallel to the
arrays, i.e:
[...]
Now the question is how to pass & handle 2 sets of variadic
parameters?
void fun(Args...)(Args args)
if (args.length % 2 == 0)
{
alias firstSet = args[0 .. $/2];
alias secondSet = args[$/2 .. $];
// rest of function body goes here
}
You will probably also want to include some `static asserts` to
make sure each set contains arguments of the appropriate types.