<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 14 Oct 2024 at 12:54, Walter Bright via Digitalmars-d <<a href="mailto:digitalmars-d@puremagic.com">digitalmars-d@puremagic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 10/11/2024 8:44 AM, Manu wrote:<br>
> No that's wrong; this is EXACTLY the situation that move semantics exist to <br>
> address. Move constructor like this should ACTUALLY BE a move constructor!<br>
<br>
But currently this(S) is an rvalue constructor, not a move constructor. I've <br>
said this many times.<br>
<br>
Changing it would break existing code.<br></blockquote><div><br></div>CASE STUDIES</div><div class="gmail_quote"><br></div><div class="gmail_quote">
<div>The fact it theoretically exists doesn't make its existence useful or even sensible.</div><div></div><div>It <i>might </i>break code; but we really need to identify whether that code IS ALREADY BROKEN. I would give a 75% odds that any code using that pattern is actually broken already, and I give exactly zero cares if we break already broken code in service of correcting the single biggest gaping hole at the heart of D.</div><div></div><div>I would also put a ~60-80% wager on any real-world instance of that pattern <i>already</i> being some kind of move constructor, which will only benefit from this change...</div><div>I would put maybe 90%+ odds on any given instance of this declaration being written by a D amateur, who actually didn't understand what they were writing, and possibly thought it does something that it doesn't actually do; that is, I would wager with almost 100% probability, that if this exists in the wild, it's essentially an accident. (probably a failed attempt at a move constructor)</div><div><br></div><div>There is NO CONCEIVABLE USE for this pattern as it is today, outside a weird syntactic hack with some very weird calling semantics... so; we need case studies to consider.</div><div>We're just going to break this code, and you're just going to have to come good with that. I will personally submit a PR to every single repo affected by this change.<br></div></div></div>