January 25, 2006
If you insert a dot before the recursive factorial call,
it will work correctly.

-----------
template factorial(int n)
{
  static if (n<2) const int factorial = 1;
  else const int factorial = n * factorial!(n-1);
}

template rhino(alias hippo)
{
  const int rhino = hippo!(2);
}

const int lion = rhino!(factorial);
--------------
February 05, 2006
Don Clugston schrieb am 2006-01-25:
> If you insert a dot before the recursive factorial call,
> it will work correctly.
>
> -----------
> template factorial(int n)
> {
>    static if (n<2) const int factorial = 1;
>    else const int factorial = n * factorial!(n-1);
> }
>
> template rhino(alias hippo)
> {
>    const int rhino = hippo!(2);
> }
>
> const int lion = rhino!(factorial);
> --------------

Added to DStress as http://dstress.kuehne.cn/run/t/template_26_A.d http://dstress.kuehne.cn/run/t/template_26_B.d

Thomas