http://d.puremagic.com/issues/show_bug.cgi?id=9299

           Summary: std.algorithm.minPos of const(int)[]
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from [email protected] 2013-01-12 02:40:50 PST ---
import std.algorithm: minPos;
void main() {
    const(int)[] a1 = [2, 3, 1, 4];
    assert(minPos(a1) == [1, 4]);
    immutable int[] a2 = [2, 3, 1, 4];
    assert(minPos(a2) == [1, 4]);
}


DMD 2.062alpha gives:

...\dmd2\src\phobos\std\algorithm.d(1489): Error: cannot modify const
expression target
...\dmd2\src\phobos\std\algorithm.d(6183): Error: template instance
std.algorithm.move!(const(int)) error instantiating
test.d(4):        instantiated from here: minPos!("a < b", const(int)[])
test.d(4): Error: template instance std.algorithm.minPos!("a < b",
const(int)[]) error instantiating
...\dmd2\src\phobos\std\algorithm.d(1489): Error: cannot modify immutable
expression target
...\dmd2\src\phobos\std\algorithm.d(6183): Error: template instance
std.algorithm.move!(immutable(int)) error instantiating
test.d(6):        instantiated from here: minPos!("a < b", immutable(int)[])
test.d(6): Error: template instance std.algorithm.minPos!("a < b",
immutable(int)[]) error instantiating

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

Reply via email to