title: Passing const char* as template argument
body: <p>Why can't you pass literal strings in here? I made it work with a very slight workaround.</p>
  
  <pre><code>template&lt;const char* ptr&gt; struct lols {
      lols() : i(ptr) {}
      std::string i;
  };
  class file {
  public:
      static const char arg[];
  };
  decltype(file::arg) file::arg = __FILE__;
  // Getting the right type declaration for this was irritating, so I C++0xed it.
  
  int main() {
      // lols&lt;__FILE__&gt; hi; 
      // Error: A template argument may not reference a non-external entity
      lols&lt;file::arg&gt; hi; // Perfectly legal
      std::cout &lt;&lt; hi.i;
      std::cin.ignore();
      std::cin.get();
  }
  </code></pre>