https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108645

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Evan Teran from comment #1)
> Which results in the same behavior, so it appears to be that the:
> 
> ```
> basic_string operator+(basic_string &&, basic_string &&)
> ```
> 
> Overload doesn't steal the guts of the rhs at all?


Because it steals the guts of the LHS instead, which is fine because they're
both rvalues, and it's simpler to append to the LHS than to insert at the
beginning of the RHS.


> 
> But the 
> 
> ```
> basic_string operator+(const basic_string &, basic_string &&)
> ```
> 
> overload does?


Because it can't steal the guts from the const lvalue on the left.

Closing as not a bug because the current behaviour is conforming and I don't
see a compelling reason to change anything.

Reply via email to