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

RazvanN <razvan.nitu1...@gmail.com> changed:

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

--- Comment #5 from RazvanN <razvan.nitu1...@gmail.com> ---
(In reply to Walter Bright from comment #2)
> An object with a copy constructor cannot be blitted into place. (Such is not
> allowed in C++, either, and such constructors are rejected by the compiler.)
> 
> There is no advantage to doing it anyway over passing by ref.

Yes there is. You may want to construct from an rvalue, therefore you cannot
use a copy constructor since rvalue references are not yet implemented in the
language (there is a switch but it is only half implemented). `this(S)` does
exactly that. Of course, it is illegal to have both this(S) and this(ref S).

We discussed this extensively in the DIP.

--

Reply via email to