View source code
Display the source code in std/sumtype.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

std.sumtype.SumType.opAssign - multiple declarations

Function SumType.opAssign

Assigns a value to a SumType.

ref SumType opAssign (
  T rhs
);

Assigning to a SumType is @system if any of the SumType's members contain pointers or references, since those members may be reachable through external references, and overwriting them could therefore lead to memory corruption.

An individual assignment can be @trusted if the caller can guarantee that there are no outstanding references to any of the SumType's members when the assignment occurs.

Function SumType.opAssign

Copies the value from another SumType into this one.

ref SumType opAssign (
  ref SumType rhs
);

See the value-assignment overload for details on @safety.

Copy assignment is @disabled if any of Types is non-copyable.

Function SumType.opAssign

Moves the value from another SumType into this one.

ref SumType opAssign (
  SumType rhs
);

See the value-assignment overload for details on @safety.

Authors

Paul Backus

License

Boost License 1.0