title: Template Metaprogramming - I still don't get it :(
body: <p>I have a problem... I don't understand template metaprogramming.</p>
  <p>The problem is, that I’ve read a lot about it, but it still doesn’t make much sense to me.</p>
  <p><strong>Fact nr.1</strong>: Template Metaprogramming is <strong>faster</strong></p>
  <pre><code>template &lt;int N&gt;
  struct Factorial 
  {
      enum { value = N * Factorial&lt;N - 1&gt;::value };
  };
   
  template &lt;&gt;
  struct Factorial&lt;0&gt; 
  {
      enum { value = 1 };
  };
   
  // Factorial&lt;4&gt;::value == 24
  // Factorial&lt;0&gt;::value == 1
  void foo()
  {
      int x = Factorial&lt;4&gt;::value; // == 24
      int y = Factorial&lt;0&gt;::value; // == 1
  }
  </code></pre>
  <p>So this metaprogram is faster ... because of the constant literal.</p>
  <p><strong>BUT</strong>: Where in <em>the real world</em> do we have constant literals? Most programs I use react on user input.</p>
  <p><strong>FACT nr. 2</strong> : Template metaprogramming can accomplish <strong>better maintainability.</strong></p>
  <p>Yeah, the factorial example may be maintainable, but when it comes to complex functions, I and most other C++ programmers can't read them.</p>
  <p>Also, the debugging options are very poor (or at least I don't know how to debug).</p>
  <p>When does template metaprogramming make sense?</p>