5 ms·
But Zig doesn't need a keyword to trigger it either? If it's possible at all, it will be done. The keyword should just prevent run-time evaluation. (Unless I gr
by jhgb 10mo ago
But Zig doesn't need a keyword to trigger it either? If it's possible at all, it will be done. The keyword should just prevent run-time evaluation. (Unless I grossly misunderstood something.)
- WalterBright 10mo agoI'm no expert on Zig, but "comptime" is the keyword to trigger it.
- jhgb 10mo agoI'm pretty sure the "comptime" keyword only forces you to provide an argument constant at compile time for that particular parameter. It doesn't trigger the compile time evaluation.
- WalterBright 10mo agoThat's how the constant is provided - through compile time evaluation.
- jhgb 10mo agoYes, but compile-time evaluation in Zig doesn't require the "comptime" keyword. Only specific cases such as compile-time type computation do (but these specific cases are not provided by compile-time function evaluation in D anyway, so language choice wouldn't make a difference here).