title: Template class pointer c++ declaration
body: <pre><code>template &lt;typename T&gt;
  class Node
  {...};
  
  int main
  {
      Node* ptr;
      ptr = new Node&lt;int&gt;;
  }
  </code></pre>
  
  <p>Will fail to compile I have to to declare the pointer as </p>
  
  <pre><code>Node&lt;int&gt;* ptr;
  </code></pre>
  
  <p>Why do I have to specify the type when declaring a pointer I haven't created the class yet, why does the compiler have to know what type it will be pointing to. And is it not possible to create a generic pointer and decide afterwards what type I want to assign it.</p>