title: C++ template gotchas
body: <p>just now I had to dig through the website to find out why template class template member function was giving syntax errors:</p>
  
  <pre><code>template&lt;class C&gt; class F00 {
     template&lt;typename T&gt; bar();
  };
  ...
  Foo&lt;C&gt; f;
  f.bar&lt;T&gt;(); // syntax error here
  </code></pre>
  
  <p>I now realize that template brackets are treated as relational operators.  To do what was intended the following bizarre syntax is needed, cf <a href="https://stackoverflow.com/questions/1682844/templates-template-function-not-playing-well-with-classs-template-member-functi">Templates: template function not playing well with class&#39;s template member function</a>:</p>
  
  <pre><code>f.template bar&lt;T&gt;();
  </code></pre>
  
  <p>what other bizarre aspects and gotcha of C++/C++ templates you have encountered that were not something that you would consider to be common knowledge?</p>