MemberType

Get an alias on the member type (work with nested member like "foo.bar").

Members

Aliases

MemberType
alias MemberType = typeof(__traits(getMember, t, members))
Undocumented in source.
MemberType
alias MemberType = MemberType!(MemberType!(T, memberSplited[0]), memberSplited[1 .. $].join("."))
Undocumented in source.

Variables

memberSplited
enum string[] memberSplited;
Undocumented in source.

Parameters

T

the type where the member is

members

the member to alias

Examples

static class A {
    int bar;
    string baz;
}

static class B {
    A foo = new A();
}

static assert(is(MemberType!(A, "bar") == int));
static assert(is(MemberType!(A, "baz") == string));
static assert(is(MemberType!(B, "foo.bar") == int));

Meta