title: Get type of inherited instantiated template
body: <p>Is it possible to obtain the type of an instantiated template from a variable?</p>
  
  <pre><code>struct A { enum E {A_, B, C}; };
  struct B { enum E {X, Y, Z}; };
  
  class BaseClass {};
  template &lt;typename T&gt; class TemplateClass : public BaseClass {};
  
  class AChild : public TemplateClass&lt;A&gt; {};
  class BChild : public TemplateClass&lt;B&gt; {};
  
  template &lt;typename T&gt;
  class WorkerClass
  {
    static void do_stuff(const BaseClass&amp; a) {}
  };
  
  int main(void)
  {
    AChild a;
    //need to call WorkerClass&lt;A::E&gt;::do_stuff(a)
  }
  </code></pre>