taggedalgebraic

* Algebraic data type implementation based on a tagged union. * * Copyright: Copyright 2015-2016, Sönke Ludwig. * License: Boost License 1.0. * Authors: Sönke Ludwig

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(inout(TaggedAlgebraic!U) ta)

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

hasType
bool hasType(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).

Templates

TypeOf
template TypeOf(alias kind)

Maps a kind enumeration value to the corresponding field type.

Meta