Fields

Returns the types of all members of T.

If T is a $(D_KEYWORD struct) or $(D_KEYWORD union) or $(D_KEYWORD class), returns the types of all its fields. It is actually the same as T.tupleof, but the content pointer for the nested type isn't included.

If T is neither a $(D_KEYWORD struct) nor $(D_KEYWORD union) nor $(D_KEYWORD class), $(D_PSYMBOL Fields) returns an $(D_PSYMBOL AliasSeq) with the single element T.

Members

Aliases

Fields
alias Fields = typeof(T.tupleof[0 .. $ - 1])
Undocumented in source.
Fields
alias Fields = typeof(T.tupleof)
Undocumented in source.
Fields
alias Fields = AliasSeq!T
Undocumented in source.

Parameters

T

A type.

Return Value

T's fields.

Examples

struct Nested
{
    int i;

    void func()
    {
    }
}
static assert(is(Fields!Nested == AliasSeq!int));

class C
{
    uint u;
}
static assert(is(Fields!C == AliasSeq!uint));

static assert(is(Fields!short == AliasSeq!short));

Meta