title: Strange VC++ compile error, C2244
body: <p>Take a look at this peice of code:</p>
  <pre><code>template &lt;typename K,typename T&gt;
  Pointer&lt;typename Collection&lt;T&gt;::Iterator&gt; BinaryTree&lt;K,T&gt;::GetBeginning() const
  {
      return new BinaryTreeIterator(this,BinaryTreeIterator::Position::atBeginning);
  }
  </code></pre>
  <p>When I try to compile it using VSTS 2008, I get:</p>
  <pre><code>error C2244: 'BinaryTree&lt;K,T&gt;::GetBeginning' : unable to match function definition to an existing declaration
  see declaration of 'BinaryTree&lt;K,T&gt;::GetBeginning'
  2&gt;        definition
  2&gt;        'Pointer&lt;Collection&lt;T&gt;::Iterator&gt; BinaryTree&lt;K,T&gt;::GetBeginning(void) const'
  2&gt;        existing declarations
  2&gt;        'Pointer&lt;Collection&lt;T&gt;::Iterator&gt; BinaryTree&lt;K,T&gt;::GetBeginning(void) const'
  </code></pre>
  <p>The declaration:</p>
  <pre><code>Pointer&lt;Iterator&gt; GetBeginning() const;
  </code></pre>
  <p>is inside the class. BinaryTree indirectly inherits from Collection, and BinaryTreeIterator indirectly inherits from Iterator, both nested classes of their respective containers.</p>
  <p>You can easily see that even in the error report, both definition and declaration are identical. Is there really something wrong here?</p>
  <p>I found that microsoft released a <a href="http://support.microsoft.com/kb/930198" rel="nofollow noreferrer">hotfix</a>: &quot;Certain template code does not compile, and error C2244 occurs after you install Visual Studio 2005 Service Pack 1&quot;. However I couldn't find any reference to VSTS 2008.</p>
  <p>So first I wanted to check if anybody could spot a real error in the code at a glance, and if it's VS's fault, does anyone know if the above hotfix is the solution and is relevant for 2008 as well.</p>