Bug 8067 – std.algorithm.move doesn't work for static array of elaborate struct

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-05-08T10:20:38Z
Last change time
2022-08-31T09:23:17Z
Keywords
bootcamp
Assigned to
No Owner
Creator
Kenji Hara

Comments

Comment #0 by k.hara.pg — 2012-05-08T10:20:38Z
This code doesn't work. import std.algorithm, std.traits; void main() { static int postblit, dtor; static struct S2 { this(this){ ++postblit; } ~this(){ ++dtor; } } S2[3] sa21; postblit = dtor = 0; S2[3] sa22 = move(sa21); assert(postblit == 0); // fails }
Comment #1 by verylonglogin.reg — 2012-11-03T12:50:28Z
Fixed with all other `move` issues in [provoking] https://github.com/D-Programming-Language/phobos/pull/923
Comment #2 by simon.buerger — 2014-02-22T08:02:54Z
*** Issue 12224 has been marked as a duplicate of this issue. ***
Comment #3 by razvan.nitu1305 — 2022-08-31T09:23:17Z
This code successfully compiles and runs. closing as fixed.