Is there a way to implement "getSymbolOfCall" and "getDelegateOfCall" such that doit is functionally equivalent to calling the method directly?

auto doit(C, string methodName, Args...)(C c, Args args) {
    alias methodSymbol = getSymbolOfCall!(c, methodName, Args);
    pragma(msg, hasUDA!(methodSymbol, "my attr"));
    auto dg = getDelegateOfCall!(c, methodName, Args);
    return dg(args);
}

They should deal with getting the right overload, opDispatch-ing, and deducing template arguments from the real argument list to get a concrete delegate pointer. methodSymbol should give access to compile-time introspection like full signature and UDAs.

The ability to do this for non-member functions would be cool too, but is beyond my use case.

Reply via email to