title: C++: Can we avoid to systematically specify all the template types?
body: <p>I have a template class where the template definition if very long</p>
  
  <pre><code>template&lt;typename firstType, typename secondType, typename thirdType, typename fourthType, typename fifthType, typename sixthType&gt;
  </code></pre>
  
  <p>In the .cpp file, writing this entire template in front of each function definition is long and make reading a little difficult. Consider this <code>set</code> function</p>
  
  <pre><code>template&lt;typename firstType, typename secondType, typename thirdType, typename fourthType, typename fifthType, typename sixthType&gt;
  void myClass&lt;firstType, secondType, thirdType, fourthType, fifthType, sixthType&gt;::set(firstType x)
  {
     ...
  }
  </code></pre>
  
  <p>It would be nice to be able to do</p>
  
  <pre><code>TEMPLATEDEFINITIONS
  void myClass&lt;MYTEMPLATES&gt;::set(double x)
  {
     ...
  }
  </code></pre>
  
  <p>instead and the compiler would somehow knows to replace <code>TEMPLATEDEFINITIONS</code> and  <code>MYTEMPLATES</code> with the appropriate strings. Is something like that possible (without having to <code>sed</code> in the makefile)?</p>