title: C++ Class inheriting from template class without knowing the type?
body: <p>I am designing a template class Policy which needs to be able to handle pointers to other classes.</p>
  
  <pre><code>template &lt;class P&gt;
  class Policy
  {
    private:   
      const P *state;
    public:
      Policy (P const* s) : state(s){};
  };
  </code></pre>
  
  <p>This works fine.
  Now I want to inherit from the above template class and create new subclasses:</p>
  
  <pre><code>class Greedy : public Policy&lt;???&gt;
  {
    public:
      template &lt;typename P&gt; Greedy (P const* s) : Policy(s) {}:
  };
  
  class Explora : public Policy&lt;???&gt;
  { 
    public:
      template &lt;typename P&gt; Explora (P const* s) : Policy(s) {}:
  };
  </code></pre>
  
  <p>Problem is that when defining those classes I do not know what type they will be using for the base template class. Is this even possible to do ?
  I want the type obtained from the inherited class constructor (probably templated), and then pass it to the base class construtor.
  Can I do that ? If yes, how ? typedefining enums ?
  I have seen <a href="https://stackoverflow.com/questions/5927648/inheriting-from-a-template-class-using-a-type-defined-in-the-derived-class">this question</a> but it doesn't in my opinion really answer the question.</p>