title: calling a function from a friend function defined in a header in c++
body: <p>I have redefined the <code>&gt;&gt;</code> operator as a friend function in a template class in the header.  In it, i need to call another function called <code>inputHelper</code> that I have also defined in the header. (input helper is recursive)</p>
  
  <p>the header file is as follows:</p>
  
  <pre><code>template&lt; typename NODETYPE &gt; class Forest
  {
      /* (other friends) */
      friend void inputHelper(istream&amp; file, int previousDepth,
          ForestNode&lt;NODETYPE&gt;&amp; previousNode, ForestNode&lt;NODETYPE&gt; *nodeArray,
          int nodeCount)
      {
          /* (dostuff) */
          if(someconditional)
          {
              /* call inputHelper */
          }
      }
  
      friend istream&amp; operator&gt;&gt;(istream&amp; file, Forest&lt;NODETYPE&gt;&amp; f1)
      {
          /* (dostuff) */
          /* (call inputHelper) */
      }
  public:
      /* ... */
  private:
      /* ... */
  }
  </code></pre>
  
  <p>However, at compile, it says <code>|140|error: 'inputHelper' was not declared in this scope|</code>.  Do you have to do something special because they are both defined as friend functions in the header?  I kind of understand that <code>inputHelper</code> is outside of the scope of the class, but I'm not sure how to resolve this.</p>