Constructs a SumType holding a specific value.
Constructs a SumType that's a copy of another SumType
Calls the destructor of the SumType's current value.
@disabled if any member type is non-copyable.
The types a SumType can hold.
Assigns a value to a SumType.
Copies the value from another SumType into this one.
Moves the value from another SumType into this one.
Compares two SumTypes for equality.
A tagged union that can hold a single value from any of a specified set of types.
The value in a SumType can be operated on using pattern matching.
To avoid ambiguity, duplicate types are not allowed (but see the "basic usage" example for a workaround).
The special type This can be used as a placeholder to create self-referential types, just like with Algebraic. See the "Arithmetic expression evaluator" example for usage.
A SumType is initialized by default to hold the .init value of its first member type, just like a regular union. The version identifier SumTypeNoDefaultCtor can be used to disable this behavior.