The OpenD Programming Language

TypeOf

Maps a kind enumeration value to the corresponding field type.

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

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