title: What's the life time of the string object passed into std::runtime_error's ctor?
body: <p>According to <a href="http://en.cppreference.com/w/cpp/error/runtime_error" rel="nofollow noreferrer">cppreferences</a>, <code>explicit runtime_error( const std::string&amp; what_arg );</code> won't copy <code>what_arg</code>'s content.</p>
  
  <p>Can I safely pass a temporary string object into <code>std::runtime_error</code>'s <code>ctor</code>?</p>
  
  <p>For example:</p>
  
  <pre><code>std::string GetATempString(const char* msg)
  {
      return { msg };
  }
  
  int main()
  {
      try {
          throw std::runtime_error(GetATempString("Hello"));
      } catch (const std::runtime_error&amp; e) 
      {
              e.what(); // Is it guaranteed that "Hello" would be returned safely?
      }
  }
  </code></pre>