title: Template template parameters
body: <p>It seems understanding template template parameters will kill me :(, Let me explain what misconception I made in my mind which confuses me:</p>
  <pre class="lang-cpp prettyprint-override"><code>template&lt;class T&gt;
  class B {}; // A templated class
  </code></pre>
  <p>Here is other code:</p>
  <pre class="lang-cpp prettyprint-override"><code>template&lt;template&lt;class X&gt; class Z = B&gt; // The problem is in this line for me
  class BB{};
  </code></pre>
  <p>Note the line in the parameter list of templated class BB, which is:</p>
  <pre class="lang-cpp prettyprint-override"><code>template&lt;class X&gt; class Z = B
  </code></pre>
  <p>Now, what stops C++ to think that Z is not another templated class Z?</p>
  <p>I.e.,</p>
  <pre class="lang-cpp prettyprint-override"><code>template&lt;class X&gt; class Z {
  }
  </code></pre>
  <p>rather than thinking class Z is a templated parameter itself.</p>