Getting All Instantiations of a Template

dsimcha dsimcha at yahoo.com
Sat Oct 24 11:54:24 PDT 2009


Is there currently a way in D2 to get the parameters of all instantiations of
a template in a given scope?  For example:

class Foo {

    template instantiateMe(T) {
        void instantiateMe(T arg) {}
    }


    void foo() {
        int i;
        instantiateMe(i);
    }

    void bar() {
        float f;
        instantiateMe(f);
    }

    alias allInstantiations!instantiateMe allArgs; // (int, float)
}



More information about the Digitalmars-d mailing list