Grouping variadic parameter tuples on offset and stride

Nordlöw via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jan 21 14:24:55 PST 2016


I'm currently developing a new lazy variadic generic 
range/algorithm substitute() at

https://github.com/nordlow/justd/blob/master/substitution.d#L261

I plan to propose for Phobos.

It is meant to be used as

     assert(`do_it`.substitute(`_`, ` `,
                               `d`, `g`,
                               `i`, `t`,
                               `t`, `o`)
                   .equal(`go to`));

I'm currently only lacking one thing ...namely a way to group the 
parameters of the call to a variadic function based on their 
offset and stride. That is if have

haystack.substitute(x0, y0,
                     x1, y1,
                     x2, y2, ...);

How do I extract x0,x1,x2 into a one parameter tuple and y0,y1,y2 
into another?


More information about the Digitalmars-d-learn mailing list