https://issues.dlang.org/show_bug.cgi?id=15982
--- Comment #5 from ag0ae...@gmail.com --- (In reply to sigod from comment #4) > I bet no one uses `array()` for duplicating > arrays. I don't think betting on these things is a good course of action. The function is documented to allocate a new array. Changing that is a breaking change. > Function called `array` for a reason. Because it gives you array where you > have only an input range. It doesn't make sense to do anything if you > already have an array. In normal code you will never call `array` for array. Here's a little generic function that relies on std.array.array's current behavior: ---- immutable(ElementType!R)[] toImmutableArray(R)(R range) if (isInputRange!R && !hasIndirections!(ElementType!R)) { import std.array: array; import std.exception: assumeUnique; return assumeUnique(range.array); } ---- --