Function Optional.opAssign

Assigns a value to the optional or sets it to none.

ref auto opAssign (
  const None
);

ref auto opAssign(U) (
  auto ref U lhs
)
if (isMutable!T && isAssignable!(T, U));

ref auto opAssign(U) (
  auto ref Optional!U lhs
)
if (isMutable!T && isAssignable!(T, U));

If T is of class type, interface type, or some function pointer than passing in null sets the optional to none internally