Well the result is assigned to an immutable int, shouldn't that be a compile
const too?

2010/10/3 Denis Koroskin <[email protected]>

> On Sun, 03 Oct 2010 14:54:06 +0400, Emil Madsen <[email protected]> wrote:
>
>  So I wrote a program, to find prime numbers, just to check out this pure
>> thing;
>>
>> http://gist.github.com/608493
>>
>> However, the program has a runtime of about 5 seconds? - in my mind, if
>> the
>> function is pure, shouldn't the compiler insure that it was evaluated at
>> compiletime? - or am I doing it wrong?
>>
>>
> Make your result an "enum" (i.e. compile-time constant) if you really want
> to calculate it in compile-time:
>
> enum primes = calcPrimes();
>



-- 
// Yours sincerely
// Emil 'Skeen' Madsen

Reply via email to