ketmar wrote:

still, why `__ctfe` was designed as variable, and not as `enum ctfe = <bool>;`?

ah, sorry, i remembered. that was stupid question.

the rationale is: `static if` and `static assert` are processed *before* CTFE phase. i.e. CTFE interpreter never sees them, and cannot do the choice. and on semantic analysis phase it is not known yet if the code is for CTFE or not. that is, to allow `static assert(__ctfe)` to work, the whole semantic phase must be redesigned.

Reply via email to