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



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



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




Commit pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/9461ff427ea5b9ad012e2145d43dadcac4b700d8


 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