title: I don't know what's wrong with my code - Binary Tree
body: <p>I'm now making a Binary Tree in C++, using friend class.</p>
  
  <p>But, something is wrong, and I cannot know what should I change</p>
  
  <pre><code>template &lt;class Type&gt;
  class BinaryTree{
  public:
  
  BinaryTree(){
      root = new BTNode&lt;Type&gt;();  
      currentNode = NULL;
  }
  ~BinaryTree(){
      delete root, currentNode;
  };
  
  void insertItem(Type data){
      if(currentNode==NULL){
          Item = data;
          currentNode = root;
      }
      if(data&lt;currentNode){
          if(currentNode-&gt;Left.is_empty()){
              currentNode-&gt;Left = new BTNode(data);
              currentNode = root;
              return;
          }
          else{
              currentNode = currentNode-&gt;Left;
              return insertItem(data);
          }
      }
      if(data&gt;currentNode){
          if(currentNode-&gt;Right.is_empty()){
              currentNode-&gt;Right = new BTNode(data);
              currentNode = root;
              return;
          }
          else{
              currentNode = currentNode-&gt;Right;
              return insertItem(data);
          }
      }
      currentNode = root;
      return; 
  }
  
  void deleteItem(Type data){}
  void is_empty(){
      if (this == NULL) return 1;
      else return 0;
  }
  void printInOrder(){                                
      if(!(currentNode-&gt;Left).is_empty()){
          currentNode = currentNode-&gt;Left;            
      }
  }
  
  private:
      BTNode&lt;Type&gt;* currentNode;
      BTNode&lt;Type&gt;* root;
  };
  </code></pre>
  
  <p>and here the BTNode class that store the item of BinaryTree, and point the next Node:</p>
  
  <pre><code>template &lt;class Type&gt;
  class BTNode{
  public:
  
      friend class BinaryTree&lt;Type&gt;;
  
      BTNode(){}
      BTNode(Type data){
          Item = data;
      }
      ~BTNode(){}
  
  
  private:
      Type Item;
      BTNode&lt;Type&gt; *Left, *Right;
  };
  </code></pre>
  
  <p>The Binary Tree class's BTNode*root point the first Node, and currentNode will point the 'current node' while doing something like insertion or merging the nodes.</p>
  
  <p>But when I compile, the Compiler Error C2143 occurs in the BinaryTree class,
  here:</p>
  
  <pre><code>BTNode&lt;Type&gt;* root;
  BTNode&lt;Type&gt;* currentNode;
  </code></pre>
  
  <p>The error says that there is no toke <code>;</code> in front of <code>&lt;</code>
  but I cannot know what is wrong</p>