memberFunctionsOf

Returns a list of member functions of T

You can retireve them as a tuple of aliases, or strings

Members

Aliases

asAliases
alias asAliases = AliasesOf!(T, memberFunctionsOf!T.asStrings)

Get as a tuple of aliases

asStrings
alias asStrings = FilterMembersOf!(T, hasFunctionMember)

Get as tuple of strings

Examples

import std.meta: AliasSeq;
struct A {
    void opCall() {}
    void g() {}
}

struct B {
    int m;
    A a;
    alias a this;
    void f0() {}
    void f1() {}
}

immutable array = [memberFunctionsOf!B.asStrings];
alias strings = memberFunctionsOf!B.asStrings;
alias aliases = memberFunctionsOf!B.asAliases;

static assert(array == ["f0", "f1"]);
static assert(strings == AliasSeq!("f0", "f1"));

static assert(is(typeof(array) == immutable string[]));
static assert(is(typeof(strings) == AliasSeq!(string, string)));
static assert(is(typeof(aliases) == AliasSeq!(typeof(B.f0), typeof(B.f1))));

Meta