title: In C++, can you dynamically decide which class to use as a template?
body: <p>I have:</p>
  <pre><code>template &lt;class InputClass&gt;
  public Child: public Parent&lt;InputClass&gt;{
     //...
  }
  </code></pre>
  <p>I am evolving it so that:</p>
  <pre><code>class A{/**/};
  class B{/**/};
  class C{/**/};
  
  template &lt;class InputClass&gt;
  public Child: public Parent&lt;/*either A, B, or C depending on some if or switch statements*/&gt;
  }
  </code></pre>
  <p>I can't find a way to do this elegantly in C++.</p>