So assuming this following snippet:
var my_var: ?SomeType = ...;
...
if (my_var) |captured| {
...
}
Why is "captured" const here unless I do:
var my_var: ?SomeType = ...;
...
if (my_var) |*captured| {
...
}
I'm confused because I don't understand why I need to capture a pointer to "captured" in order to be able to modify it.
I'd understand if it was:
const my_var: ?SomeType = ...
Because here "my_var" is const, so I'd understand the need to capture a pointer