3 ms·
I had to try it out first, but yep, that's how it works: const assert = @import("std").debug.assert; fn get12() i32 { const opt_opt_val: ??i32
by flohofwoe 4y ago
I had to try it out first, but yep, that's how it works:
const assert = @import("std").debug.assert;
fn get12() i32 {
const opt_opt_val: ??i32 = 12;
const val = opt_opt_val.?.?;
comptime assert(val == 12);
return val;
}
[https://www.godbolt.org/z/oncd5shvP https://www.godbolt.org/z/oncd5shvP]