Move Constructor Syntax

Manu turkeyman at gmail.com
Fri Oct 18 23:27:33 UTC 2024


On Sat, 19 Oct 2024, 09:06 An via Digitalmars-d, <
digitalmars-d at puremagic.com> wrote:

> On Monday, 14 October 2024 at 02:49:42 UTC, Walter Bright wrote:
> > On 10/11/2024 8:44 AM, Manu wrote:
> >> No that's wrong; this is EXACTLY the situation that move
> >> semantics exist to address. Move constructor like this should
> >> ACTUALLY BE a move constructor!
> >
> > But currently this(S) is an rvalue constructor, not a move
> > constructor. I've said this many times.
> >
> > Changing it would break existing code.
>
> What about considering these syntax in new Edition that D is
> advocate for breaking changes?
> `this(S)`, `this(ref S)`, `opAssign(S)`, `opAssign(ref S)`
>

We have no case studies; as far as we've determined so far, this is the
only potentially breaking change, and we have no evidence yet other than
theory that it actually is a breaking change.

Let's worry about this when we actually know of a single case where it
breaks code...
I think it probably doesn't break any code, or that the code in question is
already broken...

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20241019/c81d0a28/attachment.htm>


More information about the Digitalmars-d mailing list