Feedback Thread: DIP 1040--Copying, Moving, and Forwarding--Community Review Round 1

Max Haughton maxhaton at gmail.com
Tue Mar 23 03:41:21 UTC 2021


On Tuesday, 23 March 2021 at 00:35:31 UTC, Manu wrote:
> On Fri, Mar 5, 2021 at 10:25 PM Mike Parker via Digitalmars-d < 
> digitalmars-d at puremagic.com> wrote:
>
>> [...]
>
>
> I'm really late to the party here, and there's a lot to catch 
> up, so maybe I'm repeating discussion that already happened... 
> but I think there's a few points that need consideration.
>
> [...]

Thank you for the feedback, I'm still mulling over it, but the 
idea of having move semantics for D that we can make the best 
they can possibly be, and then a solution for C++ compatibility 
seems like a good one. I'm not a huge fan of magic quasi-UDA 
things on parameters personally.

One thing I have put to Walter and would like more opinions on, 
is being a little more like Rust and less like C++ by having more 
violent move semantics that (often described as destructive) 
bypass the .init process described here. Although I'd like it, 
I'm not convinced of how practical it is, but it would greatly 
simplify analysis of the program both for a static analyzer 
(presumably the successor to ob.d) and for the programmers brain 
(e.g. think about how many value categories C++ has, and how use 
of move semantics in C++ can end up introducing a subtle new 
state to objects).



More information about the Digitalmars-d mailing list