fieldsAndMethods

More useful version of allMembers trait, that returns only fields and methods of class/struct/interface/union without service members like constructors and Object members.

Note: if Object methods are explicitly override in T (not other base class), then the methods are included into the result.

Members

Aliases

fieldsAndMethods
alias fieldsAndMethods = staticFilter!(filterUtil, __traits(allMembers, T))
Undocumented in source.
fieldsAndMethods
alias fieldsAndMethods = ExpressionList!()
Undocumented in source.

Examples

Example

struct A
{
    string a;
    float b;
    void foo();
    string bar(float);
}

class B
{
    string a;
    float b;
    void foo() {}
    string bar(float) {return "";}
}

class C
{
    override string toString() const {return "";}
}

static assert(staticEqual!(StrictExpressionList!(fieldsAndMethods!A), StrictExpressionList!("a", "b", "foo", "bar")));
static assert(staticEqual!(StrictExpressionList!(fieldsAndMethods!B), StrictExpressionList!("a", "b", "foo", "bar"))); 
static assert(staticEqual!(StrictExpressionList!(fieldsAndMethods!C), StrictExpressionList!("toString"))); 

Meta