@ctfeonly

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Dec 8 02:14:09 UTC 2017


On Thu, Dec 07, 2017 at 07:20:57PM -0700, Jonathan M Davis via Digitalmars-d wrote:
[...]
> In spite of the fact that CTFE is done at compile time, __ctfe is a
> runtime thing - it's just that it's runtime from the perspective of
> CTFE. So, stuff like static if or static assert doesn't work. You have
> to use if or a ternary operator or some other runtime conditional,
> though it's a common misunderstanding that __ctfe is used with static
> if, and people screw it up all the time. I don't know why it's a
> runtime thing rather than a compile time thing though. There's
> probably a good reason for it, but at first glance, it seems like a
> rather weird choice.
[...]

Sigh:

	https://wiki.dlang.org/User:Quickfur/Compile-time_vs._compile-time


T

-- 
Everybody talks about it, but nobody does anything about it!  -- Mark Twain


More information about the Digitalmars-d mailing list