The entry point for CTFE.

Specification: ($LINK2, Compile Time Function Execution (CTFE))


Walter Bright

Source: dinterpret.d

  • Declaration

    Expression ctfeInterpret(Expression e);

    Entry point for CTFE. A compile-time result is required. Give an error if not possible.


    e must be semantically valid expression. In other words, it should not contain any ErrorExps in it. But, CTFE interpretation will cross over functions and may invoke a function that contains ErrorStatement in its body. If that, the "CTFE failed because of previous errors" error is raised.

  • Declaration

    T ctfeEmplaceExp(T : Expression, Args...)(Args args);

    Allocate an Expression in the ctfe region.



    type of Expression to allocate

    Args args

    arguments to Expression's constructor

    Return Value

    allocated Expression

  • Declaration

    void incArrayAllocs();