4 ms·
It's an interesting pattern, but it's a shame there's no way to efficiently use one of those OptionalXIndex with zig's actual null syntax, `?` and `orelse` and
by fallingsquirrel 2y ago
It's an interesting pattern, but it's a shame there's no way to efficiently use one of those OptionalXIndex with zig's actual null syntax, `?` and `orelse` and etc. It would be smoother if you could constraint the nonexhaustive range, and let the compiler use an unused value as the niche for null. Maybe something like `enum(u32) { _ = 1...std.math.maxInt(u32) }`
- samatman 2y agoThere's an issue tracking that: https://github.com/ziglang/zig/issues/3806 https://github.com/ziglang/zig/issues/3806