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...