On Friday, 8 December 2017 at 02:14:09 UTC, H. S. Teoh wrote:
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
Woaaa... amazing job, Teoh!
It seems that no link in the wiki points to that, or I'm wrong?
That valuable stuff should be more visible...
/Paolo