<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 10 Oct 2024, 17:56 Walter Bright via Digitalmars-d, <<a href="mailto:digitalmars-d@puremagic.com" target="_blank" rel="noreferrer">digitalmars-d@puremagic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 10/8/2024 11:54 PM, Manu wrote:<br>
> Hmmmm. Well, that's not and never was a copy constructor...<br>
<br>
Well, it is. I don't recall when or why it was included in D.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">It was because postblit was riddled with problems... (maybe there's a lesson there?)</div><div dir="auto"><br></div><div dir="auto">Anyway, I thought of an issue with separating the constructor into a bespoke name; what happens when you do this: </div><div dir="auto"><br></div><div dir="auto">=this(S);</div><div dir="auto">this(S);</div><div dir="auto"><br></div><div dir="auto">Which is selected? </div><div dir="auto">What about:</div><div dir="auto"><br></div><div dir="auto">=this(S);</div><div dir="auto">this(T)(T); which overlaps the concrete case?</div><div dir="auto"><br></div><div dir="auto">This questions also exist in today's language with copy constructors, but the rules are clear; regular overload selection semantics.</div><div dir="auto"><br></div><div dir="auto">Selecting the proper function to call is a task for overload resolution, not something weird and special.</div><div dir="auto">If it behaves different than the way you manage the situation based on regular overload resolution regarding copy constructors, you're just asking for a raft of special-case related bugs that follow, and suffer more annoying edge cases which have to be manually identified and managed by the user.</div><div dir="auto"><br></div><div dir="auto">We need to see the ways that hit dead-ends on the paths you explored.</div><div dir="auto">I want to see the cases that lead to infinite recursions...</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>