taggedalgebraic

Algebraic data type implementation based on a tagged union.

Members

Functions

apply
auto apply(TA ta)
auto apply(T value)

Calls a the given callback with the static type of the contained value.

get
inout(T) get(ref inout(TaggedAlgebraic!U) ta)
inout(T) get(inout(TaggedAlgebraic!U) ta)

Gets the value stored in an algebraic type based on its data type.

hasType
bool hasType(in ref TaggedAlgebraic!U ta)
bool hasType(in TaggedAlgebraic!U ta)

Tests if the algebraic type stores a value of a certain data type.

Properties

disableIndex
auto disableIndex [@property getter]

User-defined attibute to disable opIndex forwarding for a particular tagged union member.

Structs

TaggedAlgebraic
struct TaggedAlgebraic(U)

Implements a generic algebraic type using an enum to identify the stored type.

Void
struct Void

Convenience type that can be used for union fields that have no value (void is not allowed).

Meta

Authors

Sönke Ludwig