The OpenD Programming Language

Checked.opAssign

Assignment operator. Has the same constraints as the constructor.

struct Checked(T, Hook = Abort)
ref return
opAssign
(
U
)
(
U rhs
)
if (
is(typeof(Checked!(T, Hook)(rhs)))
)
if (
is(T == Checked!(U, H),
U
H
)
)

Parameters

rhs U

The value to assign

Return Value

Type: Checked

A reference to this

Examples

Checked!long a;
a = 42L;
assert(a == 42);
a = 4242;
assert(a == 4242);
Checked!long a, b;
a = b = 3;
assert(a == 3 && b == 3);

Meta