digitalmars.D.bugs - [Issue 9314] New: std.algorithm.minCount of const(int)[]
- d-bugmail puremagic.com Jan 13 2013
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








d-bugmail puremagic.com