Templates vs CTFE

Max Samukha spambox at d-coding.com
Thu Jan 6 09:51:59 PST 2011


On 01/06/2011 07:49 PM, Max Samukha wrote:
> template staticMap(alias pred, A...)
> {
> static if (A.length)
> alias TypeTuple!(pred!(A[0]), staticMap!(A[1..$])) staticMap;
> }
>

Should be:

template staticMap(alias pred, A...)
{
     static if (A.length)
         alias TypeTuple!(pred!(A[0]), staticMap!(A[1..$])) staticMap;
     else
         alias TypeTuple!() staticMap;
}





More information about the Digitalmars-d mailing list