https://issues.dlang.org/show_bug.cgi?id=15982
Issue ID: 15982
Summary: std.array.array treats dynamic arrays as input ranges
and allocates new memory
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: phobos
Assignee: [email protected]
Reporter: [email protected]
import std.array : array;
int[] a = [1, 2, 3];
assert(a.ptr == array(a).ptr); // fails
I think for dynamic arrays `array()` should just return provided value without
doing anything.
--