sumtype

A sum type for modern D.

SumType is an alternative to std.variant.Algebraic with improved pattern-matching, full attribute correctness (pure, @safe, @nogc, and nothrow), and no dependency on runtime type information (TypeInfo).

Members

Structs

SumType
struct SumType(TypesParam...)

A tagged union that can hold a single value from any of a specified set of types

Templates

match
template match(handlers...)

Calls a type-appropriate handler with the value held in a SumType.

Meta

Authors

Paul Backus