This code fails struct NoCopy { int payload; // some payload ~this() { } // destructor to observe moving @disable: this(this); // make it non copyable } void f(NoCopy[2]) { } void main() { import std.algorithm.mutation : move; NoCopy[2] ncarray = [ NoCopy(1), NoCopy(2) ]; static assert(!__traits(compiles, f(ncarray) // would copy )); f(move(ncarray)); // fails } move wants to copy content. This is not a dup of 8067.
PR - https://github.com/dlang/phobos/pull/6810
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/a3fdf76c092e7c4852986316598ec882ab0d46c1 Fix Issue 18913 - Cannot move static array of non-copyable type https://github.com/dlang/phobos/commit/e03499831700e60daf9d58ada076646f178618ab Merge pull request #6810 from edi33416/issue_18913 Fix Issue 18913 - Cannot move static array of non-copyable type merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>