CTFE Status 2

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 3 13:54:05 PDT 2017


On Monday, 3 July 2017 at 06:15:44 UTC, Stefan Koch wrote:
> On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch 
> wrote:
> [ ... ]

This code works now as well ;)

int maxFloat()
{
   float prev = 1;
   foreach(int i; 0 .. int.max)
   {
     if (i == prev++)
       return i;
   }
   return int.max;
}

static assert(maxFloat() == 16777216);


More information about the Digitalmars-d mailing list