If I have a C function that has a mutable pointer as a parameter which it uses as an output parameter (it sets the pointer's value without reading), is there any way I can set the output destination to an optional variable? The function looks like
fn fillValue(val: [*c]T) void
and I'm trying to do
var x: ?T = undefined;
fillValue(&x);
I can achieve this by using a temporary and copying into x, but is there a nicer way? It's also possible to get pointers from captures, but that requires the optional to be non-null initially.