TypeOf

Maps a kind enumeration value to the corresponding field type.

kind must be a value of the TaggedAlgebraic!T.Kind enumeration.

Members

Aliases

FT
alias FT = FieldTypeTuple!U[kind]
Undocumented in source.
FT
alias FT = uda[0]
Undocumented in source.
FT
alias FT = void
Undocumented in source.
TypeOf
alias TypeOf = ReplaceType!(This, U, FT)
Undocumented in source.
TypeOf
alias TypeOf = FT
Undocumented in source.
Types
alias Types = UnionKindTypes!(typeof(kind))
Undocumented in source.
U
alias U = TemplateArgsOf!(typeof(kind))
Undocumented in source.
U
alias U = typeof(kind)
Undocumented in source.
uda
alias uda = AliasSeq!(__traits(getAttributes, kind))
Undocumented in source.

Examples

static struct S {
	int a;
	string b;
	string c;
}
alias TU = TaggedUnion!S;

static assert(is(TypeOf!(TU.Kind.a) == int));
static assert(is(TypeOf!(TU.Kind.b) == string));
static assert(is(TypeOf!(TU.Kind.c) == string));

Meta