https://issues.dlang.org/show_bug.cgi?id=21317

RazvanN <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |[email protected]
         Resolution|---                         |INVALID

--- Comment #1 from RazvanN <[email protected]> ---
The copy constructor DIP specifies that the copy constructor may be called only
in the case of lvalues; in the case of rvalues a move is performed implicitly.
The cited paragraph: "When a copy constructor is defined for a struct, all
implicit blitting is disabled for that struct" was referring only to lvalues
because that is where you would normally call a copy constructor (although, I
agree that the wording should have been better). 

In this situation the compiler constructs S(1) in the stack of f and then does
a move. This is not optimal, but it has nothing to do with copy constructors.
Since you already filed an enhancement request for this code, I am going to
close this issue as it has nothing to do with copy constructors.

--

Reply via email to