Alias TypeOf
Maps a kind enumeration value to the corresponding field type.
alias TypeOf(alias kind)
= ReplaceType!(This,U,FT);
kind
must be a value of the TaggedAlgebraic!T
enumeration.
Example
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));