3 ms·
compile time function evaluation is "nice" in the same way those features are, isn't it?
by zem 1y ago
compile time function evaluation is "nice" in the same way those features are, isn't it?
- WalterBright 1y agoWhat's interesting is that other languages have since adopted CTFE, but they missed the point and did it wrong. The usual mistake is to add a keyword necessary to trigger it. D triggers it when an expression appears where a "const-expression" appears in the grammar. I.e: int x = f(); // f() is run at run time enum y = f(); // f() is run at compile time