http://d.puremagic.com/issues/show_bug.cgi?id=5661
Summary: std.algorithm.move does not work on elaborate struct Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: major Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: k.hara...@gmail.com --- Comment #0 from Kenji Hara <k.hara...@gmail.com> 2011-02-27 21:30:08 PST --- Created an attachment (id=924) testcase std.algorithm.move does not work on T that hasElaborateDestructor!T or hasElaborateCopyConstructor!T. This test should work. ---- unittest { static struct S { static struct X { int n = 0; ~this(){n = 0;} } X x; } static assert(hasElaborateDestructor!S); S s1, s2; s1.x.n = 1; move(s1, s2); assert(s1.x.n == 0); assert(s2.x.n == 1); static struct T { static struct X { int n = 0; this(this){n = 0;} } X x; } static assert(hasElaborateCopyConstructor!T); T t1, t2; t1.x.n = 1; move(t1, t2); assert(t1.x.n == 0); assert(t2.x.n == 1); } ---- See also attached file of full test case. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------