taggedalgebraic.taggedalgebraic

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

Public Imports

taggedalgebraic.taggedunion
public import taggedalgebraic.taggedunion;

Members

Aliases

TypeEnum
deprecated alias TypeEnum(U) = UnionFieldEnum!U
Undocumented in source.

Enums

safeOnly
enum safeOnly

User-defined attribute to enable only safe calls on the given member(s).

Functions

algebraic
auto algebraic(TU tagged_union)

Converts a given TaggedUnion to a TaggedAlgebraic.

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.

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

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

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.

Meta