@ctfeonly
E.S. Quinn
onetruequinn at hotmail.com
Thu Dec 7 06:33:42 UTC 2017
On Thursday, 7 December 2017 at 05:53:06 UTC, bauss wrote:
> On Thursday, 7 December 2017 at 04:45:15 UTC, Jonathan M Davis
> wrote:
> As I understand it, with the way CTFE works,
>> it pretty much can't know whether a function can be called at
>> compile time until it tries
>>
>> - Jonathan M Davis
>
> I think that's the point of the attribute. You tell the
> compiler that this function can only be called at compile-time
> and any attempt to call it during run-time would be an error.
If all you need is a runtime error, you can already put
assert(__ctfe); in your function.
More information about the Digitalmars-d
mailing list