title: What type should I catch if I throw a string literal?
body: <p>I am writing a pretty simple application in C++ using g++ under Linux and I am trying to throw some raw strings as exceptions (yes, I know, its not a good practise).</p>
  
  <p>I have the following code (simplified):</p>
  
  <pre><code>int main()
  {
    try
    {
      throw "not implemented";
  
    }
    catch(std::string &amp;error)
    {
      cerr&lt;&lt;"Error: "&lt;&lt;error&lt;&lt;endl;
    }
    catch(char* error)
    {
      cerr&lt;&lt;"Error: "&lt;&lt;error&lt;&lt;endl;
    }
    catch(...)
    {
      cerr&lt;&lt;"Unknown error"&lt;&lt;endl;
    }
  }
  </code></pre>
  
  <p>And I get <code>Unknow error</code> on the console. But if I static cast the literal string to either <code>std::string</code> or <code>char *</code> it prints <code>Error: not implemented</code> as expected. My question is: so what is the type I should catch if I don't want to use static casts?</p>