vibe.d beta banner
get vibe.d
0.8.4

Asynchronous I/O that doesn’t get in your way, written in D

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.Kind 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));
}
Authors

Sönke Ludwig

Copyright

Copyright 2015-2016, Sönke Ludwig.

License

www.boost.org/LICENSE_1_0.txt, Boost License 1.0.