CTFE Status

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Mon Jan 2 11:01:43 PST 2017


On Monday, 2 January 2017 at 18:40:44 UTC, Stefan Koch wrote:
> So guys.
>
> basic function-calls are supported.
>
> Hell YEAH!

Meaning this will compile :

uint caller(uint n)
{
   return callee(n, 2);
}

uint callee(uint a, uint b)
{
   return a*b;
}

static assert(caller(3) == 6);
static assert(caller(24) == 48);


uint rfn(uint n)
{
   if (n) return n + rfn(n-1);
   return 1;
}

pragma(msg, rfn(2000));



More information about the Digitalmars-d mailing list