#Get optional value pointer?

1 messages · Page 1 of 1 (latest)

fast tartan
#

Hello, Is it possible to get a pointer to the value of an optional when it's not null in a single line?
something like this:

var simulation = &simulation_optional orelse return;

vivid crater
#
var simulation = &(simulation_optional orelse return);
#

but in most cases it is probably nicer code to do:

if (simulation_optional) |*simulation| {
    [...]
}