digitalmars.D.bugs - [Issue 20869] New: `std.algorithm.mutation : move` is overly
- d-bugmail puremagic.com (35/35) May 28 2020 https://issues.dlang.org/show_bug.cgi?id=20869
https://issues.dlang.org/show_bug.cgi?id=20869 Issue ID: 20869 Summary: `std.algorithm.mutation : move` is overly trusting of `opPostMove` Product: D Version: D2 Hardware: x86 OS: Mac OS X Status: NEW Keywords: safe Severity: enhancement Priority: P1 Component: phobos Assignee: nobody puremagic.com Reporter: pro.mathias.lang gmail.com ``` import std.algorithm.mutation; struct S { void opPostMove(const ref S old) system nothrow pure { int* ptr = cast(int*)42; *ptr = 42; } int a; } void main () safe nothrow { S s1; s1.a = 41; S s2 = move(s1); assert(s2.a == 42); } ``` --
May 28 2020