How to expand an expression along with a parameter tuple?

TommiT tommitissari at hotmail.com
Sat Jul 6 11:01:39 PDT 2013


On Tuesday, 18 June 2013 at 10:57:00 UTC, Artur Skawina wrote:
>
>    template _TypeMap(alias MAP, size_t N, TS...) {
>        static if (N<TS.length)
>            alias _TypeMap = _TypeMap!(MAP, N+1, TS[0..N], 
> typeof(MAP(TS[N].init), TS[N..$]));
>        else
>            alias _TypeMap = TS;
>    }

There were some typos. Here's the correct one:

template _TypeMap(alias MAP, size_t N, TS...) {
   static if (N<TS.length)
       alias _TypeMap = _TypeMap!(MAP,
                                  N+1,
                                  TS[0..N],
                                  typeof(MAP(TS[N].init)),
                                  TS[N+1..$]);
   else
       alias _TypeMap = TS;
}


More information about the Digitalmars-d-learn mailing list