Advantages of using user-defined literal for strings instead of string literal
<p>The strings topic in the SO Documentation used to say, in the Remarks section:</p>

<blockquote>
  <p>Since C++14, instead of using <code>"foo"</code>, it is recommended to use <code>"foo"s</code>, as <code>s</code> is a string literal, which converts the <code>const char *</code> <code>"foo"</code> to <code>std::string</code> <code>"foo"</code>.</p>
</blockquote>

<p>The only advantage I see using</p>

<pre><code>std::string str = "foo"s;
</code></pre>

<p>instead of</p>

<pre><code>std::string str = "foo";
</code></pre>

<p>is that in the first case the compiler can perform copy-elision (I think), which would be faster than the constructor call in the second case.</p>

<p>Nonetheless, this is (not yet) guaranteed, so the first one might also call a constructor, the copy constructor.</p>

<p>Ignoring cases where it is <em>required</em> to use <code>std::string</code> literals like</p>

<pre><code>std::string str = "Hello "s + "World!"s;
</code></pre>

<p>is there any benefit of using <code>std::string</code> literals instead of <code>const char[]</code> literals?</p>