News for hackers. Stuff that matters.
Re:Partially Matching Zig Enums by Laremere on Saturday August 09, 2025 @06:42AM (#44845467)
It's not an optimization. What gets evaluated via the lazy evaluation is well defined. Control flow which has a value defined at comptime will only evaluate the path taken. In the op example, the block is evaluated twice, once for each enum value, and the inner switch is followed at comptime so only one prong is evaluated.

There are no comments on this comment yet.