Using traits get a list of methods and filter out the member vars.

Adam D. Ruppe destructionator at gmail.com
Sun Sep 8 11:41:55 PDT 2013


Something along the lines of

static if(__traits(compiles, __traits(getMember, Foo, member))
    static if(is(__traits(getMember, Foo, member) == function)) {
      // use it
    }


The __traits(compiles, ...) is my go-to thingy for filtering out 
random errors.


More information about the Digitalmars-d-learn mailing list