[Issue 17448] Move semantics cause memory corruption and cryptic bugs

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 30 15:12:03 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=17448

--- Comment #47 from Steven Schveighoffer <schveiguy at gmail.com> ---
I should rephrase my query.

currently, if you create an appropriately written `opPostMove`, then the D
library calls that when it's doing a semantic move of your type (e.g. if you
use `std.algorithm.move`)

But I can't find a case where the *compiler* is doing a semantic move of the
type. If there are no cases, then DIP1014 is already implemented, right? My
query is really does anyone have any cases where the compiler performs the
move?

Re-parsing this bug report, I think the original request (provide a way to have
an actual registration system that updates pointers when a move is done) is
possible now. I feel this bug was closed for the wrong reason (i.e. toy
examples aren't compiling any more), and I want to be sure it's actually
possible now.

The language *should* be more forthcoming on what constitutes a move, and what
the compiler must do if it decides to move a struct.

--


More information about the Digitalmars-d-bugs mailing list