I have a function that does:
fn set(i: *u64) void {
i.* = 2
}
I have an optional:
var result: ?u64 = null;
And I want to do this without the tmp var:
fn doit(result: *?u64) void {
var tmp: u64 = undefined;
set(&tmp);
result.* = tmp;
}
const S = struct {
result_here: ?u64,
};
const result_struct = S{.result_here = null};
doit(&result_struct.result_here);