Operating on a Variadic Function Parameter Set

"Nordlöw" via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Nov 16 06:28:06 PST 2014


On Sunday, 16 November 2014 at 11:40:16 UTC, Nordlöw wrote:
> If I have a variadic function such as in
>
>     haystack.find(needles)
>
> what options do I have for defining needles in compile-time 
> outside of this expression and call find() with this definition 
> as arguments possibly multiple-times?
>
> Is std.typecons.Tuple my only option here?
>
> Further, is it possible to operate on this parameter set in 
> compile-time such as in my case reversing all the arguments 
> before feeding them as a variadic set of function parameters?
>
> I need this in my module
>
> https://github.com/nordlow/justd/blob/master/skip_ex.d#L122
>
> when implementing skipOverBackShortestOf who needs to call 
> retro on each of the needles.

I cracked skipOverBackShortestOf too at

https://github.com/nordlow/justd/blob/master/skip_ex.d#L133

:)


More information about the Digitalmars-d-learn mailing list