Error: llroundl cannot be interpreted at compile time, because it has no available source code
mw
mingwu at gmail.com
Mon Jun 8 18:53:33 UTC 2020
On Monday, 8 June 2020 at 18:43:58 UTC, Stanislav Blinov wrote:
> On Monday, 8 June 2020 at 18:08:57 UTC, mw wrote:
>
>> 2) even it does so, but why such simple function as lroundl
>> cannot be CTFE-ed?
>
> Because, as the error message states, there's no source for it
> :) std.math calls into C math library.
OK, but the compiler knows it's external C func:
return core.stdc.math.llroundl(x);
And with a symbol-to-c-func table, it should be able to just call
that C func.
This is dramatically enhance CTFE's eval ability, esp for math
funcs.
More information about the Digitalmars-d-learn
mailing list