eitherRef

This overload enables, when possible, lvalue return.

BUG: this overload is not chosen over std.algorithm.either so function must currently be called eitherRef instead of either.

ref
Ts[0]
eitherRef
(
Ts...
)
(
ref Ts a
)
if (
a.length != 0 &&
allSame!Ts
)

Examples

int x = 1, y = 2;
eitherRef(x, y) = 3;
assert(x == 3);
assert(y == 2);

Meta