December 17, 2022 [Issue 16332] std.algorithm.copy uses too restricted array specialization | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16332 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P1 |P3 -- |
February 28, 2023 [Issue 16332] std.algorithm.copy uses too restricted array specialization | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16332 Nick Treleaven <nick@geany.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@geany.org --- Comment #1 from Nick Treleaven <nick@geany.org> --- Complete example: import std.algorithm : copy; struct Foo { int[] i; void opAssign(const(Foo) other) { i = other.i.dup; } } void main() { const(Foo)[] cfoo; foreach (i; 1 .. 4) cfoo ~= Foo([i]); Foo[] foo = new Foo[](3); //cfoo.copy(foo); // NG, should be equivalent to: foreach(idx; 0 .. cfoo.length) foo[idx] = cfoo[idx]; assert(foo == cfoo); } -- |
Copyright © 1999-2021 by the D Language Foundation