restore

Restores the given variable to the value it was when it was passed to the function after the delegate has finished.

restore
(
U = void
T
)
(
ref T val
)

Parameters

val T

variable that will be restored

Return Value

Type: RestoreStruct!(U, T)

a RestoreStruct

Examples

int a = 3;

restore(a) in {
    a = 4;
}

assert(a == 3);

See Also

RestoreStruct

Meta