Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
May 03, 2011 [Issue 5924] New: schwartzSort of Tuple!(char)[] | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=5924 Summary: schwartzSort of Tuple!(char)[] 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 2011-05-03 04:41:04 PDT --- D2 code: import std.algorithm, std.typecons; void main() { //Tuple!(int)[] chars; // OK Tuple!(char)[] chars; // Error schwartzSort!((c){ return c[0]; })(chars); } It doesn't compile with DMD 2.052: ...\dmd\src\phobos\std\algorithm.d(5911): Error: template instance SortedRange!(Zip!(char[],Tuple!(char)[]),myLess) does not match template declaration SortedRange(Range,alias pred = "a < b") if (isRandomAccessRange!(Range)) ...\dmd\src\phobos\std\algorithm.d(5912): Error: SortedRange!(Zip!(char[],Tuple!(char)[]),myLess) is used as a type You can't sort efficiently the items of an Unicode string because in general they don't have the same length. But a dynamic array of Tuple!(char) is composed by items 1 byte long, and generally it's not meant to be a string. So in this case I expect schwartzSort to be able to sort it. Current workaround: import std.algorithm, std.typecons; void main() { Tuple!(char)[] chars; schwartzSort!((c){ return cast(int)c[0]; })(chars); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
May 03, 2011 [Issue 5924] schwartzSort of Tuple!(char)[] | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=5924 Andrei Alexandrescu <andrei@metalanguage.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |andrei@metalanguage.com AssignedTo|nobody@puremagic.com |andrei@metalanguage.com -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 25, 2013 [Issue 5924] schwartzSort of Tuple!(char)[] | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=5924 --- Comment #1 from github-bugzilla@puremagic.com 2013-02-24 16:52:47 PST --- Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/48c38ddd2c17fc431056e990fd8919c6d97c4d89 Issue 5924 fix https://github.com/D-Programming-Language/phobos/commit/118d9182a908777d9776fc6aa0d704bced0a8a51 Merge pull request #1169 from andralex/5924 Fix Issue 5924 - schwartzSort of Tuple!(char)[] -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 25, 2013 [Issue 5924] schwartzSort of Tuple!(char)[] | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=5924 Alex Rønne Petersen <alex@lycus.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED CC| |alex@lycus.org Resolution| |FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 25, 2013 [Issue 5924] schwartzSort of Tuple!(char)[] | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=5924 bearophile_hugs@eml.cc changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED | --- Comment #2 from bearophile_hugs@eml.cc 2013-02-25 04:51:08 PST --- Currently reverted: https://github.com/D-Programming-Language/phobos/commit/a8f180a7c71b902b7fc92dcc31e8be8d5b7a9d1e -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 26, 2013 [Issue 5924] schwartzSort of Tuple!(char)[] | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=5924 --- Comment #3 from github-bugzilla@puremagic.com 2013-02-25 20:28:37 PST --- Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/56c47cecbe277b7274931c2d925fb13db2b9302c Issue 5924 fix https://github.com/D-Programming-Language/phobos/commit/707a60101b41ac54af2f757beec89875fe51ac37 Merge pull request #1172 from andralex/5924 Fixes Issue 5924 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 26, 2013 [Issue 5924] schwartzSort of Tuple!(char)[] | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=5924 Alex Rønne Petersen <alex@lycus.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation