exchange

exchange
(
T
U
)
(
ref shared(T) store
,
U val
)

Examples

shared(int) n = 1;
auto temp = exchange(n, 10);
assert(n == 10);
assert(temp == 1);