Re: Grouping variadic parameter tuples on offset and stride

2016-01-22 Thread Nordlöw via Digitalmars-d-learn
On Thursday, 21 January 2016 at 22:35:09 UTC, H. S. Teoh wrote: Try this: import std.meta; template Stride(size_t stride, size_t offset, Args...) if (stride > 0) { static if (offset >= Args.length) alias Stride = AliasSeq!();

Re: Grouping variadic parameter tuples on offset and stride

2016-01-21 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Jan 21, 2016 at 10:24:55PM +, Nordlöw via Digitalmars-d-learn wrote: [...] > 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, >

Grouping variadic parameter tuples on offset and stride

2016-01-21 Thread Nordlöw via Digitalmars-d-learn
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`,