title: Problem trying to cast generically a derived templated class
body: <p>I'm trying to cast a template derived class to a parent class without knowing it's type.</p>
  
  <p>This is a simplification of the code I have :</p>
  
  <pre><code>/* Base Class */
  class Base {};
  
  /* Templated derived Class */
  template&lt;typename T&gt;
  class ATemplate : public Base {  
    public:
      T GetData();
  
    private:
      T _data;
  };
  
  /* Derived class */
  template&lt;typename T&gt;
  class Derived : public ATemplate&lt;T&gt; {
  };
  
  void main() {
      std::vector&lt;Base*&gt; vector;
      vector.push_back(new Derived&lt;int&gt;());
  
      for (auto var : vector) {
          if (dynamic_cast&lt;ATemplate&lt;/* I don't know the type of this class*/&gt;&gt;) {
             /* Do stuff */
          }
      }
  }
  </code></pre>
  
  <p>I have a list of Base and I want to dynamic_cast each class of this list to ATemplate.</p>
  
  <p>I would like not to have one cast for each type I created. A friend (cc killian.G) told me I could maybe use std::variant.
  Someone know if what I'm asking is possible ?</p>