title: How to use templated struct in class c++
body: <p>I am trying to use  templated <code>struct</code> within a class, but cant figure out how to declare it properly</p>
  
  <pre><code>template&lt;typename var&gt;
  struct Node
  {
      var value;
      Node* left;
      Node* right;
  };
  
  class Tree
  {
  public:
      Tree();
      ~Tree();
      template&lt;typename var&gt;
      void insert(var key, Node *node);
      template&lt;typename var&gt;
      Node* search(var key, Node *node);
      void deleteTree(Node *node);
      void inOrderTraversePrint(Node* node);
      void preOrderTraversePrint(Node* node);
      void postOrderTraversePrint(Node* node);
      Node* getRoot();
      void resetRoot();
  private:
  
      Node* root;
  };
  </code></pre>
  
  <p>I keep getting couple errors " Node is not a type"  and "Invalid use of template-name Node without  an argument list".</p>
  
  <p>I know how to template single <code>class</code> and methods within or outside the class, but this is first time I am using <code>struct</code> and trying to use templated <code>struct</code> within a class.
  What is proper way to declare and use <code>templated struct</code> within a class.</p>