title: String Literal As Template Argument
body: <p>These preprocessor and template limitations of c++ are killing me.
  The goal is to convert string literals into integers.</p>
  
  <pre><code>template&lt;const char* str&gt;
  inline int LiteralToInt(){
      return __COUNTER__;
  }
  
  using std::cout;
  
  int main(){
      cout &lt;&lt; LiteralToInt&lt;"Hello"&gt;();
      cout &lt;&lt; LiteralToInt&lt;"No"&gt;();
      cout &lt;&lt; LiteralToInt&lt;"Hello"&gt;();
      return 0;
  }
  </code></pre>
  
  <p>The output would be 010 if templates accepted string literals. Is there another way to get this output and convert string literals to integers at compile time?</p>