D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10104 - std.algorithm.group of a const/immutable array
Summary: std.algorithm.group of a const/immutable array
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
: 13162 13857 (view as issue list)
Depends on:
Blocks:
 
Reported: 2013-05-17 05:08 UTC by bearophile_hugs
Modified: 2015-02-18 03:40 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2013-05-17 05:08:04 UTC
import std.algorithm: group;
void main() {
    const a = [1, 1, 2, 2];
    a.group;
}



DMD 2.063beta2:

...\dmd2\src\phobos\std\algorithm.d(3326): Error: cannot modify struct this._current Tuple!(const(int), uint) with immutable members
temp.d(4): Error: template instance std.algorithm.group!("a == b", const(int)[]) error instantiating
...\dmd2\src\phobos\std\algorithm.d(3358): Error: cannot modify struct ret._current Tuple!(const(int), uint) with immutable members
Comment 1 Peter Alexander 2014-12-14 16:35:43 UTC
*** Issue 13857 has been marked as a duplicate of this issue. ***
Comment 2 Peter Alexander 2014-12-14 16:36:46 UTC
*** Issue 13162 has been marked as a duplicate of this issue. ***
Comment 4 github-bugzilla 2014-12-17 16:08:03 UTC
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/d1ffb938b549e454038a210b7799a732751c468d
Fix Issue 10104 - Group of array of const/immutable

https://github.com/D-Programming-Language/phobos/commit/a67689b7ec7dbc2ba1c0451cad131cc018358a28
Merge pull request #2798 from Poita/Issue10104

Fix Issue 10104 - Group of array of const/immutable