Alias TypeOf
Maps a kind enumeration value to the corresponding field type.
alias TypeOf(alias kind)
= FieldTypeTuple!U[kind];
alias TypeOf(alias kind)
= FieldTypeTuple!U[kind];
kind
must be a value of the TaggedAlgebraic!T
enumeration.
Example
static struct S {
int a;
string b;
string c;
}
alias TA = TaggedAlgebraic!S;
static assert(is(TypeOf!(TA .Kind .a) == int));
static assert(is(TypeOf!(TA .Kind .b) == string));
static assert(is(TypeOf!(TA .Kind .c) == string));
}