3 ms·
> Zig has almost no restrictions on what kinds of values can be `comptime` parameters. Neither does D. The main restriction is the CTFE needs to be pure. I.e.
by WalterBright 2y ago
> Zig has almost no restrictions on what kinds of values can be `comptime` parameters.
Neither does D. The main restriction is the CTFE needs to be pure. I.e. you cannot call the operating system in CTFE (this is a deliberate restriction, mainly to avoid clever malware).
CTFE isn't "special" in D, either. CTFE is triggered for any instance of a "constant expression" in the grammar, and doesn't require a keyword.