title: Defining a Single Template for a Member Function within a Class Template with Both Templates Used in Member Function
body: <p>I'm currently learning how templates work in C++. In particular, I'm looking at the single member function templates within class templates. To understand what I mean, code is found below.</p>
  <pre><code>// foo.h
  template&lt;typename A&gt;
  class foo {
      template&lt;typename B&gt;
      void boo(B);
  };
  
  // foo.cpp
  template&lt;typename A&gt;
  void foo&lt;A&gt;::boo(B value) {} // compiler error: 'Unknown' type name B
  
  // or if I try this
  
  template&lt;typename B&gt;
  void foo&lt;A&gt;::boo(B value) {} // compiler error: Use of undeclared identifier A
  </code></pre>
  <p>I'm trying to use two typenames, one from the class template, and one from the single file template, for that specific function. But in those two versions above, I get compiler errors. How would I bypass this problem?</p>