__rvalue and Move Semantics first draft
Walter Bright
newshound2 at digitalmars.com
Sat Nov 9 22:59:34 UTC 2024
On 11/9/2024 8:15 AM, Richard (Rikki) Andrew Cattermole wrote:
> 1. We'll need to introduce a swap builtin, since we have no way to say describe
> moves between parameters. This can come later, as it is an addition.
Doesn't a swap function get arguments passed by `ref`?
> 2. I have the concern that existing code that is not designed to accept a move,
> will have a move into it. White listing via an attribute ``@move`` to say that
> this constructor/opAssign is designed to handle a move in would be valuable.
This can work, but if the users have to proactively add this attribute, I'm
afraid we've failed.
> 3. Optimizing of eliding of destructors should be done with type state analysis,
> it does not need its own dedicated DFA.
The two are the same, aren't they?
More information about the dip.development
mailing list