title: C++ simple template recursion
body: <p>I'm pretty sure the solution to the following problem is quite standard but I couldn't find the right terms to search for it. I've two classes, say, <code>SomeB&lt;A&gt;</code> and <code>SomeA&lt;B&gt;</code>. I want to create an instance of <code>SomeB&lt;A&gt;</code> where <code>A:=SomeA&lt;B&gt;</code> and <code>B:=SomeB&lt;A&gt;</code>. The (simplified) code looks like:</p>
  
  <pre><code>template&lt;typename A&gt;
  class SomeB
  {
      A getA() { /* ... */ }
  };
  
  template&lt;typename B&gt;
  class SomeA
  {
      B getB() { /* ... */ }
  };
  
  int main(int argc, char **argv)
  {
      SomeA&lt;SomeB&lt;SomeA&lt;SomeB&lt;...&gt; &gt; &gt; &gt; test;
      //                       /\
      //                        |
      //                        +---- recursion
      test.getB();
      return 0;
  }
  </code></pre>
  
  <p>Now, how do I tell the compiler that there no "suprises" like in <code>SomeA&lt;SomeB&lt;SomeA&lt;SomeB&lt;Suprise_AnotherA&lt;...&gt;&gt;&gt;&gt;&gt;</code>?</p>