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

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed May 31 00:06:21 PDT 2017


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

--- Comment #13 from Eyal <eyal at weka.io> ---
(In reply to Andrei Alexandrescu from comment #10)

> Indeed, the spec should clarify under what circumstances objects can be
> moved.

Could we get compile-time errors when we accidentally do something that moves a
struct that should be unmovable?

Currently we do:

  @disable this(this);
  @disable void opAssign(typeof(this));

Could we also do:

  @disable move; // or any other syntax

So that we can remove a constant worry about accidental code that moves structs
that shouldn't?

Getting compile-time detection of these issues is far more important than which
exact code triggers these issues in the first place.

We can always work around detected issues. But we can't get our debugging time
back...

--


More information about the Digitalmars-d-bugs mailing list