Bug 22488 – data should work with const/immutable Array's
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-11-07T17:47:17Z
Last change time
2021-11-09T09:10:05Z
Keywords
pull
Assigned to
No Owner
Creator
moonlightsentinel
Comments
Comment #0 by moonlightsentinel — 2021-11-07T17:47:17Z
Array.data can only be called on a mutable object even though it simply exposes the underlying storage. The method should propagate the `constness` to the returned array instead.
Comment #1 by dlang-bot — 2021-11-07T17:51:05Z
@MoonlightSentinel created dlang/phobos pull request #8311 "Fix 22488 - Add inout to allow Array.data for const/immutable Array's" fixing this issue:
- Fix 22488 - Add inout to allow Array.data for const/immutable Array's
Simply propagate the const'ness to the return slice.
https://github.com/dlang/phobos/pull/8311
Comment #2 by dlang-bot — 2021-11-08T05:34:15Z
dlang/phobos pull request #8311 "Fix 22488 - Add inout to allow Array.data for const/immutable Array's" was merged into stable:
- b124dc2d07d93ed30de448095afae1889d1ec627 by MoonlightSentinel:
Fix 22488 - Add inout to allow Array.data for const/immutable Array's
Simply propagate the const'ness to the return slice.
https://github.com/dlang/phobos/pull/8311
Comment #3 by dlang-bot — 2021-11-09T09:10:05Z
dlang/phobos pull request #8313 "Merge `stable` in `mater`" was merged into master:
- a22571f59a9fdf06738bea56bac54799a6b7bc3b by MoonlightSentinel:
Fix 22488 - Add inout to allow Array.data for const/immutable Array's
Simply propagate the const'ness to the return slice.
https://github.com/dlang/phobos/pull/8313