June 27, 2017
https://issues.dlang.org/show_bug.cgi?id=15982

Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dlang-bugzilla@thecybershad
                   |                            |ow.net
         Resolution|---                         |WONTFIX

--- Comment #11 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
As discussed above, std.array.array currently guarantees that the data it returns is unique. This guarantee in turn allows some assumptions, such as that writing to the result will not have side effects, that it is safe to pass to other parts of the program, or even delete it. I suppose that if the array were to point to immutable elements, avoiding reallocation might be worth considering; though, currently, even .idup will duplicate an immutable array.

As it is, this issue is missing a use case, and it will probably need to be a compelling one to warrant changing the function's contract and risking code breakage. Other than that... well, if you don't want your array reallocated, then just don't call array()?

Please reopen if you have a good argument why this should be changed despite the above.

--
1 2
Next ›   Last »