title: error: expected a type, got 'struct' c++
body: <p>I got a class:</p>
  
  <pre><code>template &lt;typename T&gt; 
  class btree {
  
    public:
      btree(size_t maxNodeElems);
      ~btree() {}
  
      struct node {  
        list &lt;T&gt; elements;
        node *lvl;
      };
  
    private:
      size_t maxNodeElems;
      node*  root;   
  
  };
  
  template &lt;typename T&gt;
  btree&lt;T&gt;::btree(size_t maxNodeElems) {
    if (maxNodeElems &gt; 0) maxNodeElems = maxNodeElems;
    root = new node;
    root-&gt;lvl = new node[maxNodeElems+1];
  }
  
  template &lt;typename T&gt;
  pair &lt;typename btree&lt;T&gt;::iterator, bool&gt; btree &lt;T&gt;::insert (const T&amp; elem) {
    pair &lt;btree&lt;T&gt;::node, bool&gt; start;
    start = addElement (elem, *root);
    pair &lt;typename btree&lt;T&gt;::iterator, bool&gt; final;
    return final;
  }
  
  template &lt;typename T&gt;
  pair &lt;btree&lt;T&gt;::node, bool&gt; btree&lt;T&gt;::addElement (const T&amp; e, btree&lt;T&gt;::node*&amp; n) {
  
    n-&gt;elements.push_back(e);
    return make_pair(*n, true);
  }
  </code></pre>
  
  <p>the error that it keeps giving is:</p>
  
  <pre><code>error:   expected a type, got 'btree::node'
  error: invalid type in declaration before ';' token
  At global scope:
  error: type/value mismatch at argument 1 in template parameter list for 'template&lt;class _T1, class _T2&gt; struct std::pair'
  error:   expected a type, got 'btree::node'
  </code></pre>
  
  <p>This seems to be happening on the line: </p>
  
  <pre><code>pair &lt;btree&lt;T&gt;::node, bool&gt; btree&lt;T&gt;::addElement (const T&amp; e, btree&lt;T&gt;::node*&amp; n) {
  </code></pre>
  
  <p>I'm calling it the same way in the header, and I don't understand why its saying I'm not giving it the right type. Can someone explain this to me?</p>