title: C++ nested class function return type and namespace
body: <p>I have the following problem, with nested class(in this case a <code>struct</code>) namespace and return type</p>
  
  <pre><code>class Example
  {
  struct Node { /* with all the methods it needs */ }
  Node * func();
  }
  </code></pre>
  
  <p>now I want to put the implementation of the <code>func</code> outside the class. So what I did is:</p>
  
  <pre><code>Example::Node * Example::func()
  {
  return nullptr;
  }
  </code></pre>
  
  <p>and it worked fine, until I made <code>example</code> template</p>
  
  <pre><code>template&lt;typename T&gt;
  class Example {/* all the same here */}
  
  template &lt;typename T&gt;
  Example&lt;T&gt;::Node * Example&lt;T&gt;::func()
  {
   return nullptr;
  }
  </code></pre>
  
  <p>where I got many errors. Then I tried</p>
  
  <pre><code> template &lt;typename T&gt;
  Example::Node * Example&lt;T&gt;::func()
  {
   return nullptr;
  }
  </code></pre>
  
  <p>Where I get the error: "use of class template requires template argument list"</p>
  
  <p>As far as I know <code>Example&lt;T&gt;::func()</code> is correct, because this means that function belongs to that namespace. But I'm not sure about the return type of my function. Any help?</p>