www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9314] New: std.algorithm.minCount of const(int)[]

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9314

           Summary: std.algorithm.minCount of const(int)[]
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs eml.cc 2013-01-13 21:04:25 PST ---
Related to Issue 9299


import std.algorithm: minCount;
import std.typecons: tuple;
void main() {
    int[] a1 = [2, 3, 1, 4, 1, 1];
    assert(minCount(a1) == tuple(1, 3));
    const(int)[] a2 = [2, 3, 1, 4, 1, 1];
    assert(minCount(a2) == tuple(1, 3));
    immutable int[] a3 = [2, 3, 1, 4, 1, 1];
    assert(minCount(a3) == tuple(1, 3));
}


DMD 2.062alpha gives:

..\dmd2\src\phobos\std\algorithm.d(1541): Error: cannot modify const expression
target
..\dmd2\src\phobos\std\algorithm.d(6173): Error: template instance
std.algorithm.move!(const(int)) error instantiating
temp.d(7):        instantiated from here: minCount!("a < b", const(int)[])
temp.d(7): Error: template instance std.algorithm.minCount!("a < b",
const(int)[]) error instantiating
..\dmd2\src\phobos\std\algorithm.d(1541): Error: cannot modify immutable
expression target
..\dmd2\src\phobos\std\algorithm.d(6173): Error: template instance
std.algorithm.move!(immutable(int)) error instantiating
temp.d(9):        instantiated from here: minCount!("a < b", immutable(int)[])
temp.d(9): Error: template instance std.algorithm.minCount!("a < b",
immutable(int)[]) error instantiating

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 13 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9314


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
                 CC|                            |andrej.mitrovich gmail.com
           Platform|x86                         |All
         OS/Version|Windows                     |All


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-10-24
06:35:28 PDT ---
https://github.com/D-Programming-Language/phobos/pull/1074

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 24 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9314



--- Comment #2 from github-bugzilla puremagic.com 2013-10-24 06:35:40 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/9461ff427ea5b9ad012e2145d43dadcac4b700d8
Merge pull request #1074 from monarchdodra/9314

 Issue 9314 - std.algorithm.minCount of const(int)[]

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 24 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9314


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 24 2013