digitalmars.D - Getting All Instantiations of a Template
- dsimcha (16/16) Oct 24 2009 Is there currently a way in D2 to get the parameters of all instantiatio...
- Walter Bright (3/5) Oct 24 2009 Templates are instantiated lazily, meaning it doesn't make much sense to...
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) }
Oct 24 2009
dsimcha wrote:Is there currently a way in D2 to get the parameters of all instantiations of a template in a given scope?Templates are instantiated lazily, meaning it doesn't make much sense to figure this out at compile time.
Oct 24 2009