Another interesting hack: expand a static array into parameter arguments

w0rp devw0rp at gmail.com
Wed Apr 2 15:21:31 PDT 2014


On Wednesday, 2 April 2014 at 21:53:57 UTC, Artur Skawina wrote:
>    template expand(alias A, alias M=Delay) {
>       mixin(q{alias expand = TypeTuple!(}
>              ~ 
> iota(A.length).map!q{",M!(A,"[!a..$]~text(a)~")"}().join()
>              ~ q{);});
>    }
>
> SCNR.
>
> artur

I kind of started this whole topic off from IRC.

...

What have I done!?


More information about the Digitalmars-d mailing list